需要初始化DataAdapter.SelectCommand属性。 [英] The DataAdapter.SelectCommand property needs to be initialized.

查看:263
本文介绍了需要初始化DataAdapter.SelectCommand属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DataAdapter.SelectCommand属性需要初始化。



这是什么意思?

The DataAdapter.SelectCommand property needs to be initialized.

What dows this mean?

推荐答案

This is because the codes below is initialized with a null object actually.
like this one 




SqlDataAdapter yourdataAdapterName = new SqlDataAdapter();




Instead of using that you need to initialize the DataAdapter with a command object like below:







 SqlDataAdapter yourdataAdapterName = new SqlDataAdapter("select * from aTable",Conn);
//Conn is your connection string
//use your select command in the place of "select * from aTable"







If it is not your solution then show some code.And ask again


这篇关于需要初始化DataAdapter.SelectCommand属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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