C#和访问数据库中的问题 [英] Problem in C# and access database
问题描述
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();
我尝试过:
大家好,我在c#中有一个带访问数据库的项目,但我的datagridview无法显示我访问的所有记录,例如我有176条访问记录,但它显示168记录。
我认为这个问题与我的datagridview有关,因为我的访问保存所有新记录whitout任何问题,但我不知道这是什么?
datagridview有限制? ????
它是一个临床软件,我需要尽快解决我的问题,请帮帮我
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
推荐答案
dataGridView1.DataSource = Customer.Fill();
返回记录数。
您需要学习如何分配数据源(并成为更好的倾听者)。
这篇关于C#和访问数据库中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!