110,536
社区成员
发帖
与我相关
我的任务
分享
SqlConnection connect = new SqlConnection("server=localhost;uid=sa;password=;database=StudentsInfo");
connect.Open();
string s = "select PW from User1 where ID='123'";
SqlDataAdapter adapter = new SqlDataAdapter(s,connect);
DataSet ds = new DataSet();
adapter.Fill(ds);
string s1 = ds.Tables[0].Rows[0]["PW"].ToString();
string s1 = ds.Tables[0].Rows[0][0].ToString();