Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: Row Count Pin
cocoonwls22-Apr-08 18:39
cocoonwls22-Apr-08 18:39 
GeneralRe: Row Count Pin
Vikram A Punathambekar22-Apr-08 18:52
Vikram A Punathambekar22-Apr-08 18:52 
GeneralRe: Row Count Pin
cocoonwls22-Apr-08 19:09
cocoonwls22-Apr-08 19:09 
GeneralRe: Row Count Pin
Vikram A Punathambekar22-Apr-08 18:53
Vikram A Punathambekar22-Apr-08 18:53 
GeneralRe: Row Count Pin
Ajay.k_Singh22-Apr-08 19:36
Ajay.k_Singh22-Apr-08 19:36 
Hello Sachin,

If you are using a DataSet to connect it with Access table, you may use following syntax –

myDataSet.Tables[0].Rows.Count

If you do not know how to use DataAdapter, Connection object and DataSet I would recommend you to study Ado.Net first.

Just to give you some idea, basic code to connect to one data base file and getting its row count will look like this –

----------------------------------------------------
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\YourDatabaseFolder\\Nwind.mdb;Persist Security Info=False");

DataSet ds=new DataSet();

OleDbDataAdapter da;

private void Form1_Load(object sender, EventArgs e)
{

da= new OleDbDataAdapter("select * from customers",con);

da.Fill(ds);

}

private void button1_Click(object sender, EventArgs e)
{

MessageBox.Show( ds.Tables[0].Rows.Count.ToString());

}
------------------------------------

I hope this helps.

-Ajay.

-------------------------
www.componentone.com
-------------------------

GeneralParameter is not valid. Pin
cuongmits22-Apr-08 13:54
cuongmits22-Apr-08 13:54 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 13:58
protectorChristian Graus22-Apr-08 13:58 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:05
cuongmits22-Apr-08 14:05 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 14:08
protectorChristian Graus22-Apr-08 14:08 
GeneralRe: Parameter is not valid. Pin
Luc Pattyn22-Apr-08 16:37
sitebuilderLuc Pattyn22-Apr-08 16:37 
GeneralRe: Parameter is not valid. Pin
Jordanwb22-Apr-08 13:58
Jordanwb22-Apr-08 13:58 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:08
cuongmits22-Apr-08 14:08 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 14:10
protectorChristian Graus22-Apr-08 14:10 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:15
cuongmits22-Apr-08 14:15 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:18
cuongmits22-Apr-08 14:18 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 14:21
protectorChristian Graus22-Apr-08 14:21 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:22
cuongmits22-Apr-08 14:22 
GeneralRe: Parameter is not valid. Pin
Jordanwb22-Apr-08 14:36
Jordanwb22-Apr-08 14:36 
GeneralCalculate a formula Pin
mehrdadc4822-Apr-08 9:24
mehrdadc4822-Apr-08 9:24 
GeneralRe: Calculate a formula Pin
Christian Graus22-Apr-08 12:04
protectorChristian Graus22-Apr-08 12:04 
GeneralRe: Calculate a formula Pin
Mitch F.22-Apr-08 12:09
Mitch F.22-Apr-08 12:09 
QuestionComparing two ArrayLists ? Pin
dennycrane22-Apr-08 8:58
dennycrane22-Apr-08 8:58 
GeneralRe: Comparing two ArrayLists ? Pin
User 665822-Apr-08 9:01
User 665822-Apr-08 9:01 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 9:06
dennycrane22-Apr-08 9:06 
GeneralRe: Comparing two ArrayLists ? [modified] Pin
User 665822-Apr-08 9:15
User 665822-Apr-08 9:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.