Hi Guys...
Putting together a Tiny little app which shows VPN Details for use 'In-House' but for some strange reason my DataSet won't fill?
Can anyone spot the mistake? :S
private void Form1_Load(object sender, EventArgs e)
{
//XML Load of Document. This loads the XML Document and the value of a Single Node then inputs this to a text box//
XmlDocument doc = new XmlDocument();
doc.Load("C:\\vpn.xml");
XmlNode node = doc.SelectSingleNode("/DataBases/VPN_Access/vpn_DB");
this.txtBoxDebug.Text = node.InnerText;
//Creates new versions of the Connection string and Data Set//
con = new System.Data.OleDb.OleDbConnection();
ds = new DataSet();
//The actual connection to the database//
con.ConnectionString = "PROVIDER=Microsoft.ACE.OLEDB.12.0;Data Source =" + txtBoxDebug.Text.ToString();
//The SQL String you need to pass into the Data Adapter to collect the information//
string vpnDetails = "SELECT * FROM VPN";
da = new System.Data.OleDb.OleDbDataAdapter(vpnDetails, con);
//The Data Adapater (da) is told to fill the DataSet (ds) with the information pulled from the SQL Query and call this fill "cashCustomers"//
da.Fill(ds, "VPN");
//Opens the connection//
con.Open();
//Closes The Connection//
con.Dispose();
//Tells the dataGridView to load with the information stored in table called 'cashCustomers' in the DataSet (DS)//
dataGridView1.DataSource = ds.Tables["VPN"];
Many thanks for your help.
Mark.