【发布时间】:2016-10-25 12:10:49
【问题描述】:
我被要求处理一些使用SqlDataAdapter 的代码,我想知道这是否是正确的方法。(我查看了文档,但我的想法并不完全清楚)
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT * FROM MY_TABLE";
var Adapter = new SqlDataAdapter(cmd);
DataSet Result = new DataSet();
Adapter.Fill(Result);
编辑:认为我找到了丢失的东西:
connectionString = help.Get_MyConnectionString();
Connection = new SqlConnection(connectionString);
Connection.Open();
打开连接应该会更好 -.-"
【问题讨论】: