Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
need help in database connectivity in c#
shameer pv
Aug 26 2010 7:02 AM
1.7k
Reply
im beginner to c# ,asp.net and mysql
i write a program to access some data from mysql server.thats works fine
but i want to select a max value of a field. how can i access that value from data reader . i tried many ways . but...
code is given below
MySqlConnection con = new MySqlConnection();
con.ConnectionString = "Data Source=localhost;Database= mydatabase;User ID=root;Password=vox";
con.Open();
string str;
str = string.Format("select max(user_id) from usertable");
MySqlCommand cmd = new MySqlCommand(str, con);
MySqlDataReader dr;
dr = cmd.ExecuteReader();
how can i get that max value of user_id from data reader.
thanks in advance
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Access to form controls in classes
Combo box to upper case