存储过程如何调试
来源:百度知道 编辑:UC知道 时间:2024/07/16 01:13:15
给你一段修改的代码吧。。。
public static bool UpdateLandLastDate(UserInformation userInfor)
{
SqlConnection con = ConnectionData.DB();
con.Open();
try
{
string sql = "update testUserInformation set lastLandDate='" + userInfor.userLastLandDate + "' where userName='" + userInfor.userName + "'";
SqlCommand com = new SqlCommand(sql, con);
if (com.ExecuteNonQuery() > 0)
{
return true;
}
}
catch
{ }
finally
{
con.Close();
}
return false;
}
储存过程,直接在查询分析器里进行调试好第一步就ok了。
如果确定存储过程没有问题了,那么就是你传的参数的问题,你把你要传入的参数都加上断点,看看你传的值有什么问题,这个问题排除了,基本就能排除问题了。