茶馆

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

 今天才学会在写SQL语句的时候可以不用那么多的+号
    用sqlparameter很方便

        string SelectSQL = "select * from customers where customerid=@customerid";
        SqlCmd.Connection 
= SqlConn;
        SqlCmd.CommandText 
= SelectSQL;
        SqlCmd.Parameters.Add(
"@customerid", SqlDbType.NVarChar, 50).Value = "alfki".ToUpper();
posted on 2006-03-15 18:22  laue  阅读(2157)  评论(0)    收藏  举报