这是在App_Code里的一个CS数据操作文件:
但我就是没有找到"Pr_UpdateCategoryOrder"在哪?
在相关页面cs文件里也没有?
请指点,解决马上结账!
public int UpdateCategoryOrder(int categoryID,string moveFlag)
{ ///获取连接字符串
string connectionString = ConfigurationManager.ConnectionStrings["SQLCONNECTIONSTRING"].ConnectionString;
///创建连接
SqlConnection con = new SqlConnection(connectionString);
///设置被执行存储过程的名称
string cmdText = "Pr_UpdateCategoryOrder";
///创建SqlCommand
SqlCommand cmd = new SqlCommand(cmdText,con);
///设置执行方式为存储过程
cmd.CommandType = CommandType.StoredProcedure;
///创建参数并赋值
cmd.Parameters.Add("@ID",SqlDbType.Int,4);
cmd.Parameters.Add("@MoveFlag",SqlDbType.VarChar,20);
cmd.Parameters[0].Value = categoryID;
cmd.Parameters[1].Value = moveFlag; int result = -1;
try
{ ///打开连接
con.Open();
///操作数据
result = cmd.ExecuteNonQuery();
}
catch(Exception ex)
{ ///抛出异常
throw new Exception(ex.Message,ex);
}
finally
{ ///关闭连接
con.Close();
} return result;
}
但我就是没有找到"Pr_UpdateCategoryOrder"在哪?
在相关页面cs文件里也没有?
请指点,解决马上结账!
public int UpdateCategoryOrder(int categoryID,string moveFlag)
{ ///获取连接字符串
string connectionString = ConfigurationManager.ConnectionStrings["SQLCONNECTIONSTRING"].ConnectionString;
///创建连接
SqlConnection con = new SqlConnection(connectionString);
///设置被执行存储过程的名称
string cmdText = "Pr_UpdateCategoryOrder";
///创建SqlCommand
SqlCommand cmd = new SqlCommand(cmdText,con);
///设置执行方式为存储过程
cmd.CommandType = CommandType.StoredProcedure;
///创建参数并赋值
cmd.Parameters.Add("@ID",SqlDbType.Int,4);
cmd.Parameters.Add("@MoveFlag",SqlDbType.VarChar,20);
cmd.Parameters[0].Value = categoryID;
cmd.Parameters[1].Value = moveFlag; int result = -1;
try
{ ///打开连接
con.Open();
///操作数据
result = cmd.ExecuteNonQuery();
}
catch(Exception ex)
{ ///抛出异常
throw new Exception(ex.Message,ex);
}
finally
{ ///关闭连接
con.Close();
} return result;
}
解决方案 »
- asp.net webservice如何调用类库的方法?
- 放完假,,来提问..请问Gridview如何每隔十行就显示表头??
- 请问高手
- 关于dataset对象销毁的问题
- 菜鸟问题
- 如何用PasswordRecovery控件给用户发送密码?请大侠们给出一个例子,谢谢
- 为什么页面什么都不显示呢,莫名其妙?
- System.ComponentModel.Win32Exception: 拒绝访问怎么办啊??
- 怎样避免DropDownList增加值?
- 输出的html莫名多出一个<script id=__ie_init>
- FileUpload控件的问题
- Handler Request.Form 我怎么提不到页面的值啊 救救我啊
cmd.CommandType = CommandType.StoredProcedure;
躲在数据库里!昏倒,你没看到是执行的存储过程么?
就可以看到存储过程里写的啥了!
string cmdText = "Pr_UpdateCategoryOrder";
///创建SqlCommand
///设置执行方式为存储过程
cmd.CommandType = CommandType.StoredProcedure;
///创建参数并赋值
use [数据库名]
gosp_helptext Pr_UpdateCategoryOrder
go