.net简单的三层实现功能(5)
来源:未知 责任编辑:责任编辑 发表时间:2015-09-16 20:04 点击:次
99 }
100 return result;
101 }
102
103
104 /// <summary>
105 /// 执行无返回值的sql语句 www.2cto.com
106 /// </summary>
107 /// <param name="sqlCommand"></param>
108 /// <param name="parameters"></param>
109 public static int ExecuteNonQuery(string sqlCommand)
110 {
111 int result = 0;
112 using (DbConnection connection = GetConnection())
113 {
114 DbCommand command = GetCommand(sqlCommand, CommandType.Text, connection);
115 connection.Open();
116 result = command.ExecuteNonQuery();
117 command.Parameters.Clear();
118 return result;
119 }
120 }
121
122 /// <summary>
123 /// 执行有参数的sql语句
124 /// </summary>
125 /// <param name="sqlCommand"></param>
126 /// <param name="para"></param>
127 /// <returns></returns>
128 public static int ExecuteNonQuery(string sqlCommand, Dictionary<string, object> para)
129 {
130 int result = 0;
131 using (DbConnection connection = GetConnection())
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>