SqlConnection cn = new SqlConnection(app);
SqlCommand cmd = cn.CreateCommand();
cmd.CommandText = "select * from Accountnumber where name='admin'";
cmd.CommandType = CommandType.Text;
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataTable dt = new DataTable();
da.Fill(ds,"student");
da.Fill(dt);
MessageBox.Show(ds.Tables[1].Columns.ToString());
关于ado.net 的一个问题,无法找到表一
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- threenewbee 2015-10-08 13:50关注
把tables[1]修改为tables[0]看看
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报