1. I am using Visual Studio.NET 2005 C# Win Form
2. I have setup a database connection to my Access Database using ADO.NET
3. On my system timer I have the following code to execute every 1 sec:
Expand|Select|Wrap|Line Numbers
- private void timer1_Tick(object sender, EventArgs e)
- {
- OleDbConnection myConnection = new OleDbConnection(myConnectionString);
- OleDbCommand myCommand = new OleDbCommand("SELECT *FROM Lights_Settings", myConnection);
- OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myCommand);
- try
- {
- myConnection.Open();
- myDataAdapter.Fill(myDataSet, "Lights_Settings");
- this.textBox_north.DataBindings.Clear();
- this.textBox_north.DataBindings.Add("text", myDataSet, "Lights_Settings.North" );
- myConnection.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show("Error reading database: " + ex.Message);
- myConnection.Close();
- }
- }
Any Solutions??
thanks