Hi guys... I have a radio button that one checked will connect to an ADO Connection.
The following code being used is:
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
//Fields Disabled until a new Account is created.//
txtAccRef.Enabled = false;
txtAccName.Enabled = false;
txtAccAddr1.Enabled = false;
txtAccAddr2.Enabled = false;
txtAccTown.Enabled = false;
txtAccCounty.Enabled = false;
txtAccPostCode.Enabled = false;
//Buttons Disabled as not needed//
btnNewCashAcc.Enabled = false;
btnEditCashAcc.Enabled = false;
btnSaveCashAcc.Enabled = false;
btnDeleteCashAcc.Enabled = false;
//As Data is being pulled from Line 50 this fields have cleared.//
txtAccRef.Clear();
txtAccName.Clear();
txtAccAddr1.Clear();
txtAccAddr2.Clear();
txtAccTown.Clear();
txtAccCounty.Clear();
txtAccPostCode.Clear();
//Opens the Line 50 Connection//
adoConn.Open("SageLine50v19", "Manager", "", 0);
//Creates new versions of the Connection string and Data Set//
da = new OleDbDataAdapter();
ds4 = new DataSet();
What is best method of using an IF statement to check if this particular connection even exists on a machine?
Regards
Mark