DataAdapter的使用 属性 ∥连接字符串 string strCon=@"Data Source DataServer;Initial Catalog TestDB; Integrated Security True;"; ∥执行连接 SqlConnection sqlCon new SqlConnection(strCon); ∥查询数据表中的记录 string sltStr=@"Select No,Name,Grade from JBQK"; SqlCommand sqlCmd new SqlCommand(sltStr,sqlCon); SqlDataAdapter sda new SqlDataAdapter(sqICmd); DataSet ds new DataSet(); 20 20 DataAdapter的使用 ▪ 属性 // 连接字符串 string strCon =@"Data Source = DataServer; Initial Catalog = TestDB; Integrated Security = True;"; // 执行连接 SqlConnection sqlCon = new SqlConnection(strCon); // 查询数据表中的记录 string sltStr = @"Select No, Name, Grade from JBQK"; SqlCommand sqlCmd = new SqlCommand(sltStr, sqlCon); SqlDataAdapter sda = new SqlDataAdapter(sqlCmd); DataSet ds = new DataSet();