thanks
C# .net crystal report
i have a crystal report and i want to display only the max value of id in it from the database.PLease help in this ,stuck in this for about 3-4 days..
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 11, 2012, 6:41 AM EDT
Try
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
str = "select max(id)from tablename";
com = new OleDbCommand(str, con);
textBox1.Text = com.ExecuteScalar().ToString();
con.Close();
Thanks
Amitesh VermaRank #2,535 · 552 reputationPosted Jul 11, 2012, 9:30 PM EDT