编写了一个数据库层组件,使用Nunit测试完成,在Web页中使用却无效
各位高手,今日遇到一个极端令我困惑的问题.
数据库操作层疑问:
我写了一个数据库访问层,比如ItemsDB就代表了所有Items表的操作,在Web页中,调用数据库中的存储过程实现相应功能.使用NUnit测试了组件的所有函数,均可以正确执行.
但是在Web页中:删除,添加功能都没有问题,更新却不起任何作用,程序不报错.
有谁遇到过类似的奇怪问题,探讨探讨啊.
//例如,页面有个"更新"按钮,单击后执行:
private void ButtonUpdate_Click(object sender, System.EventArgs e)
{
OA.Component.ItemsDB itemsDB=new OA.Component.ItemsDB();
itemsDB.UpdateItem(itemID,TextBoxItemName.Text,TextBoxItemUOM.Text,
Convert.ToDouble(TextBoxUP.Text));
Response.Redirect(ViewState["UrlReferrer"].ToString());
}
//ItemsDB可能象这样, 使用 GotDotNet.ApplicationBlocks
public void UpdateItem(string itemID,string itemName,string uom,double unitPrice)
{
helper.ExecuteNonQuery(connectionString,"dbo.Items_UpdateItem",new object[]{itemID, itemName, uom, unitPrice});
}