I'm developing a simple application to insert values to ms access database but I need to make event ID as automated field by get maximum value from the column and add +1 to insert the new value
- OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\zoom\Desktop\TRAVIL IN OMAN PROJECT - Copy\WebApplication1\WebApplication1\App_Data\travilinoman.MDB.mdb");
- con.Open();
- OleDbCommand cmd = new OleDbCommand("select MAX(ID)+1 from event", con);
- OleDbDataReader dr = cmd.ExecuteReader();
- TextBox1.Text = dr.ToString();
- con.Close();
how can I convertit to the acctual value (int) ???
Amit GuptaPosted Apr 29, 2017, 11:26 AM
Sulieman AlkatibPosted Apr 29, 2017, 3:50 PM
Khaja MoizuddinPosted Apr 29, 2017, 1:00 PM
Sulieman AlkatibPosted Apr 29, 2017, 8:41 AM
Bharath PeggemPosted Apr 29, 2017, 8:28 AM