Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have ms access database in this database i have 10 tables in this 10 tables each table i have 10,000 records i want select this database file in front end through browse after selecting i need that table rows count.
Posted

Use this query
SQL
select count(*) from tablename
 
Share this answer
 
Comments
Maciej Los 15-May-12 5:04am    
Good answer, my 5!
uspatel 15-May-12 5:13am    
Thanks........
try this example...

SqlCommand selectCommand = new SqlCommand("SELECT COUNT(*) FROM tablename", thisConnection);


DataSet DsDrpLd = new DataSet();

     if (DsDrpLd.Tables[0].Rows.Count > 0)
     {
         DsDrpLd.ReadXml(MapPath("../Report.xml"));

         PagedDataSource objPds = new PagedDataSource();
         objPds.DataSource = DsDrpLd.Tables[0].DefaultView;

         objPds.AllowPaging = true;
         objPds.PageSize = 20;

         objPds.CurrentPageIndex = CurrentPage;
         lblCurrentPage.Text = "Page : " + (CurrentPage + 1).ToString() + " of                      " + objPds.PageCount.ToString();
         totalcount = Convert.ToInt32(objPds.PageCount.ToString());
         lblRecords.Text = Convert.ToString(DsDrpLd.Tables[0].Rows.Count);
     }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900