本文介绍了检查此代码中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CommonClass.ExecuteNonQuery(con,SpUpdatetbl1,parameters);

在这里,我想将值传递给ExecuteNonQuery函数,但spUpdatetbl1是我的存储过程.它显示错误,例如spUpdatetbl1在当前上下文中不存在.我如何声明此

CommonClass.ExecuteNonQuery(con, SpUpdatetbl1, parameters);

Here i want to pass value to the ExecuteNonQuery function but spUpdatetbl1 is my stored procedure. it shows error like spUpdatetbl1 does not exists in current context. how can i declare this

推荐答案

cmd.CommandText = "StoredProcedureName"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = sqlConnection1
sqlConnection1.Open()
rowsAffected = cmd.ExecuteNonQuery()


这篇关于检查此代码中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 17:43