错误是````
未处理的“System.NullReferenceException”类型的异常出现在 abc.dll 中。其他信息: 未将对象引用设置到对象的实例。指向是
sqlString.Append(" UPDATE TSUInStoreM SET CPVDID='"+table.Rows[0]["供应商编号"].ToString()+"' WHERE CSUInStoreID='"+this.dS_SUInStoreView.TSUInStoreM[0].CSUInStoreID.ToString()+"'");这是所有代码 为什么过不去~` 谁能给我讲讲啊``谢谢了!!!!!!!!!!!!!!!!
DataTable table = null;
table = HisenBA.Common.Dialog.SysInfo.ShowSelectDialog("tprovider");
// System.Text.StringBuilder sqlString = new System.Text.StringBuilder();
// sqlString.Append(" BEGIN TRAN");
//
// sqlString.Append(" UPDATE TSUInStoreM SET CPVDID='"+table.Rows[0]["供应商编号"].ToString()+"' WHERE CSUInStoreID='"+this.dS_SUInStoreView.TSUInStoreM[0].CSUInStoreID.ToString()+"'");
// sqlString.Append(" IF (@@ERROR<>0)");
// sqlString.Append(" BEGIN");
// sqlString.Append(" ROLLBACK TRAN");
// sqlString.Append(" RETURN");
// sqlString.Append(" END");
// sqlString.Append(" UPDATE TPAMoney SET CPVDID='"+table.Rows[0]["供应商编号"].ToString()+"' WHERE (CTBRGID='0503') AND (COriginID='"+this.dS_SUInStoreView.TSUInStoreM[0].CSUInStoreID.ToString()+"')");
// sqlString.Append(" IF (@@ERROR<>0)");
// sqlString.Append(" BEGIN");
// sqlString.Append(" ROLLBACK TRAN");
// sqlString.Append(" RETURN");
// sqlString.Append(" END");
// sqlString.Append(" COMMIT");
// if (!this.ws_Common.ExecuteString(sqlString.ToString()))
// {
// HisenBA.Common.Dialog.SysInfo.ShowMessage(1,"修改数据错误!");
// this.Close();
// }
this.theRefresh();
if (table != null)
{
table.Dispose();
}
// }
// else if (this.OperState < TOperState.UnConfirmView)
// { // table = HisenBA.Common.Dialog.SysInfo.ShowSelectDialog("tprovider");
// if ((null != table) && (table.Rows.Count > 0))
// {
// //this.BindingContext[dS_SUInStoreView,"TSUInStoreM"].SuspendBinding();
// dS_SUInStoreView.TSUInStoreM[0].CPVDID = table.Rows[0]["供应商编号"].ToString();
// dS_SUInStoreView.TSUInStoreM[0].CPVDName = table.Rows[0]["供应商名称"].ToString();
// this.BindingContext[dS_SUInStoreView,"TSUInStoreM"].ResumeBinding();
// }
if (table != null)
{
//table.Dispose();
System.Windows.Forms.MessageBox.Show("11111");
this.textBox2.Focus();
}
未处理的“System.NullReferenceException”类型的异常出现在 abc.dll 中。其他信息: 未将对象引用设置到对象的实例。指向是
sqlString.Append(" UPDATE TSUInStoreM SET CPVDID='"+table.Rows[0]["供应商编号"].ToString()+"' WHERE CSUInStoreID='"+this.dS_SUInStoreView.TSUInStoreM[0].CSUInStoreID.ToString()+"'");这是所有代码 为什么过不去~` 谁能给我讲讲啊``谢谢了!!!!!!!!!!!!!!!!
DataTable table = null;
table = HisenBA.Common.Dialog.SysInfo.ShowSelectDialog("tprovider");
// System.Text.StringBuilder sqlString = new System.Text.StringBuilder();
// sqlString.Append(" BEGIN TRAN");
//
// sqlString.Append(" UPDATE TSUInStoreM SET CPVDID='"+table.Rows[0]["供应商编号"].ToString()+"' WHERE CSUInStoreID='"+this.dS_SUInStoreView.TSUInStoreM[0].CSUInStoreID.ToString()+"'");
// sqlString.Append(" IF (@@ERROR<>0)");
// sqlString.Append(" BEGIN");
// sqlString.Append(" ROLLBACK TRAN");
// sqlString.Append(" RETURN");
// sqlString.Append(" END");
// sqlString.Append(" UPDATE TPAMoney SET CPVDID='"+table.Rows[0]["供应商编号"].ToString()+"' WHERE (CTBRGID='0503') AND (COriginID='"+this.dS_SUInStoreView.TSUInStoreM[0].CSUInStoreID.ToString()+"')");
// sqlString.Append(" IF (@@ERROR<>0)");
// sqlString.Append(" BEGIN");
// sqlString.Append(" ROLLBACK TRAN");
// sqlString.Append(" RETURN");
// sqlString.Append(" END");
// sqlString.Append(" COMMIT");
// if (!this.ws_Common.ExecuteString(sqlString.ToString()))
// {
// HisenBA.Common.Dialog.SysInfo.ShowMessage(1,"修改数据错误!");
// this.Close();
// }
this.theRefresh();
if (table != null)
{
table.Dispose();
}
// }
// else if (this.OperState < TOperState.UnConfirmView)
// { // table = HisenBA.Common.Dialog.SysInfo.ShowSelectDialog("tprovider");
// if ((null != table) && (table.Rows.Count > 0))
// {
// //this.BindingContext[dS_SUInStoreView,"TSUInStoreM"].SuspendBinding();
// dS_SUInStoreView.TSUInStoreM[0].CPVDID = table.Rows[0]["供应商编号"].ToString();
// dS_SUInStoreView.TSUInStoreM[0].CPVDName = table.Rows[0]["供应商名称"].ToString();
// this.BindingContext[dS_SUInStoreView,"TSUInStoreM"].ResumeBinding();
// }
if (table != null)
{
//table.Dispose();
System.Windows.Forms.MessageBox.Show("11111");
this.textBox2.Focus();
}
解决方案 »
- 关于.net编程
- 菜鸟求助。。请问怎样在图片正中间加文字?????
- 高分求解,怎样在owc 里的spreadsheet,将sheet2工作表变为当前活动,用c#代码怎样写
- 文本框中的历史记录
- 心情不爽,散分!没分,先散一点
- 我粘了一个类,想调试自己用,,报这样的错,无法从密封类“System.Data.SqlClient.SqlConnection”继承
- 客户端发送和接受消息在一个函数里怎么写
- 再问一个dataset的问题
- StreamReader读中文文件,出现乱码,哪位大峡帮忙一下,谢谢
- 为什么这句过后就不执行了?
- VS2005 Pro里面找不到可以对office开发的工程,咋回事??
- 用smpmail发送邮件的问题?
没有得到值
table为null,所以table.Rows[0]["供应商编号"].ToString()出错
我没分了``就请帮我解答了把