“System.Windows.Forms.DataGrid ... [英] 'System.Windows.Forms.DataGrid...

查看:211
本文介绍了“System.Windows.Forms.DataGrid ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlDataAdapter da = new SqlDataAdapter(q,constr);

DataTable dt = new DataTable();

da1.Fill(dt);

GridView1.DataSource = dt;

GridView1.DataBind();

SqlDataAdapter da = new SqlDataAdapter(q,constr);
DataTable dt = new DataTable();
da1.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();

推荐答案

仅使用该代码片段且没有错误消息,它几乎不可能分辨,但很可能你使用的是错误的DataAdapter。

尝试:

With just that code fragment and no error message, it's pretty much impossible to tell, but it's likely that you are using the wrong DataAdapter.
Try:
SqlDataAdapter da = new SqlDataAdapter(q,constr);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();

如果这不起作用,我们需要错误信息及其抱怨的行。

And if that doesn't work, we would need the error message, and the line it is complaining about.


这篇关于“System.Windows.Forms.DataGrid ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆