TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sulieman Alkatib
NA
56
4.7k
increment ID automatically by adding +1
Apr 29 2017 7:35 AM
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();
TextBox
1
.Text = dr.ToString();
con.Close();
the textboxis showing this result : System.Data.OleDb.OleDbDataReader
how can I convertit to the acctual value (int) ???
Reply
Answers (
5
)
asp.net registration form solution
Feeling awkward !!!!!!!!!!!