command类

command对象允许执行多种不同类型的查询。某些command对象可以采用结果集的方式获取数据,还有其他的则是会修改数据内容或者结构。

1、创建command对象

A.new

 string strConn = @"server=localhost;database=dzzw;uid=sa;pwd=**********s";

sqlConnection con = new sqlConnection(strConn);
    string strSql = "select * from 学生";;
    con.Open();
sqlCommand cmd = new sqlCommand(strSql,con);

你可能感兴趣的:(command)