string qry = "Select COUNT(rack)FROM Report "; OleDbCommand cmd = new OleDbCommand(); cmd = new OleDbCommand(qry, conn); OleDbDataReader dr = cmd.ExecuteReader();
ExecuteScalar
DataTable dt = new DataTable(); string qry = "Select COUNT(rack)FROM Report"; OleDbCommand cmd = new OleDbCommand(); cmd = new OleDbCommand(qry, conn); OleDbDataAdapter adapter = new OleDbDataAdapter(cmd); adapter.Fill(dt);//Here you are having a datatable with all your 19 columns
SqlCommand cmd=new SqlCommand("Select COUNT(rack)FROM Report"); cmd.Connection=con; con.Open(); int i=cmd.ExecuteScalar(); con.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)