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);

posted @ 2010-04-25 14:27  vita  阅读(210)  评论(0编辑  收藏  举报