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();
the textboxis showing this result : System.Data.OleDb.OleDbDataReader
how can I convertit to the acctual value (int) ???