DAL层用的微软SQLHelperBAL中 有个方法public static DataSet GetCustom()
{
string connString =DAL.SqlHelper.GetConnSting();
string sql = "select * from Custom";
DataSet ds = DAL.SqlHelper.ExecuteDataset(connString, CommandType.Text, sql); return ds;
}UI层 dvwCustom.DataSource = BAL.Custom.GetCustom(); 可是dvwCustom这个datagrid为什么没有显示数据呢?也没有报错在sqlserver里用查询语句查是有数据的
{
string connString =DAL.SqlHelper.GetConnSting();
string sql = "select * from Custom";
DataSet ds = DAL.SqlHelper.ExecuteDataset(connString, CommandType.Text, sql); return ds;
}UI层 dvwCustom.DataSource = BAL.Custom.GetCustom(); 可是dvwCustom这个datagrid为什么没有显示数据呢?也没有报错在sqlserver里用查询语句查是有数据的
解决方案 »
- 关于C#开发ActiveX参数问题
- WCF服务 是 什么
- 关于"此方法支持 .NET 基础结构,但不适合在代码中直接使用"
- HttpWebRequest用程序自动登录的问题
- 实现"撤销"功能
- 急!我的C#程序在遍历文件时窗口不动了!!!
- 怎样去掉字符串后面的三个字符?急呀!
- 程序里如何得到excel当前sheet页面的高度和宽度???
- 在将文件复制到临时文件夹时出现位置错误,安装程序将立即退出。
- .NET Framework SDK Beta 1安装时出现error 2894.internal Error 2894.126 错误如何解决??
- C#在 windowform中的textbox
- clickonce 部署提示空间不够问题
dvwCustom.DataBind(); //还得加这句
没有这个方法啊? 我用的是 System.Windows.Forms.DataGridView 这个控件
或者你绑定DataTable看看dvwCustom.DataSource = BAL.Custom.GetCustom().Tables[0];