c# - Refresh database's data -


Can I refresh the data from my database (MS Access) through a Windows form in C #? A part of the code where I insert data:

  insertCommand.Parameters.Add ("@ ID_uporabnika", OleDbType.Integer) .Value = Convert.ToInt32 (textBox6.Text); InsertCommand.Parameters.Add ("@datum", OleDbType.DBDate). Value = date time.Now ToShortDateString (); InsertCommand.Parameters.Add ("@ ID_Ziwila", OleDbType.Integer) .Value = Convert.ToInt32 (iDTextBox.Text); InsertCommand.Parameters.Add ("@ skupaj_kalorij", OleDbType.Double) .Value = Convert.ToDouble (textbox1.Text); EmpConnection.Open (); Try {int count = insertCommand.ExecuteNonQuery (); } Catch (Oldbox Exports) {Message Box. Showing (ex.Message); } Finally {empConnection.Close (); MessageBox.Show ("Zeozity obbrook J Bill Shraajen"); TextBox1.Clear (); TextBox2.Clear (); TextBox3.Clear (); TextBox4.Clear (); TextBox5.Clear (); }}  

After you insertCommand.ExecuteNonQuery (), bind data to database . Not sure that you want to populate again.

Try {int count = insertCommand.ExecuteNonQuery}; // Getting your data here // Use the narrators to populate your objects} Hold (before the obbb expression) {message box. Show (ex. Message); } Finally {empConnection.Close (); MessageBox.Show ("Zeozity obbrook J Bill Shraajen"); TextBox1.Clear (); TextBox2.Clear (); TextBox3.Clear (); TextBox4.Clear (); TextBox5.Clear (); }

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -