![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL Server
PaSifaLL
把一切都插上计算机,把科学工业化
展开
-
ASP.NET使用参数化查询
书写数据库语句string str = ConfigurationManager.ConnectionStrings["Con"].ConnectionString; SqlConnection conn = new SqlConnection(str);打开数据库连接 conn.Open();3.书写SQL语句string sql = "inser...原创 2021-04-03 20:21:18 · 498 阅读 · 0 评论 -
数据库使用
这段代码使用了SQLCommand对象,他可以使你连接数据库,处理数据 SqlCommand sqlCommand = new SqlCommand()ExecuteScalar()方法ExecuteScalar()>0这个方法会立即执行并且生效在句子内。ExecuteNonQuery()>0而如果使用这个方法并不会立即执行查询特别是在句子内。...原创 2020-03-22 11:30:42 · 251 阅读 · 0 评论