SqlDataAdapter d = new SqlDataAdapter("select * from test",ConnStr);
DataSet ds = new DataSet();
d.Fill(ds);、//错误的行
dgProduct.DataSource = ds;
dgProduct.DataBind();
提示如下:
Exception Details: System.InvalidOperationException: Fill: SelectCommand.Connection property has not been initialized
DataSet ds = new DataSet();
d.Fill(ds);、//错误的行
dgProduct.DataSource = ds;
dgProduct.DataBind();
提示如下:
Exception Details: System.InvalidOperationException: Fill: SelectCommand.Connection property has not been initialized
解决方案 »
- 100分求教 .NET菜鸟关于主题和皮肤问题的求助
- 调用过 java webservices 的请进
- checkbox问题
- 请高手指点一下!!!---如何动态更换网站的皮肤???
- 在后台代码中如何控制客户端控件?
- 在vs.net中的 aspx网页,用dreamweaver 打开 中文全是乱码
- 急急急 求高手帮我调试一个ASP程序 在线等
- 谁有asp.net中WebSetup的教程?100分送上。
- xml的问题
- Asp.Net中如何与Oracle数据库联?
- 动态radio获得的值变成00000000000000000500000000这样的字符串
- ggjj们,帮帮忙吧!!如何互相调用不同文件夹下的窗体??
SqlConnection ConnStr=new SqlConnection("连接字符串如:server=127.0.0.1;database=DBname;user id=sa;pwd=")
然后
ConnStr.Open();
...
d.fill(ds)
...
现在又提示上面这句有错:The left-hand side of an assignment must be a variable, property or indexer