Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public static DataTable Fill()
{
String SQL;
SQL = "SELECT * FROM Customer ";
DataTable dt = new DataTable();
DataBase db = new DataBase();
dt = db.ExecuteSelect(SQL);
return dt;

}

and then in form load and form activated event write this code
C#
dataGridView1.DataSource = Customer.Fill();


What I have tried:

Hi every one ,I have a project in c# with access database but my datagridview cant show all the record of my access, for example i have 176 records in access but it show 168 record.
I think this problem related to my datagridview, because my access save all new record whitout any problem , but i dont know what is this?
datagridview has Limitations????

its a software for a clinick , and i need solve my problem soon, please help me
Posted
Updated 15-Feb-19 8:39am
v6
Comments
CHill60 15-Feb-19 11:15am    
We really need to see your code that you are using to populate the datagridview, or details of the data binding. You cannot send us your project. Use the Improve Question link to add the missing information
Maciej Los 15-Feb-19 11:19am    
And you think we can guess what's wrong with your code without seeing it?
Member 13938930 15-Feb-19 11:24am    
How can i send my project ?
MadMyche 15-Feb-19 11:55am    
Paste the CODE
Member 13938930 15-Feb-19 12:08pm    
ok
my project is in 3 layer
I write this code for this function
public static DataTable Fill()
{
String SQL;
SQL = "SELECT * FROM Customer ";
DataTable dt = new DataTable();
DataBase db = new DataBase();
dt = db.ExecuteSelect(SQL);
return dt;

}
and then in form load and form activated event write this code
dataGridView1.DataSource = Customer.Fill();
................
but it cant show all of my recode
after 168th record it dont show anything else

1 solution

dataGridView1.DataSource = Customer.Fill();

"Returns" the number of records.

You need to learn how to assign a "data source" (and be a better listener).

How to: Bind data to the Windows Forms DataGridView control | Microsoft Docs[^]
 
Share this answer
 

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