C#语言Accsees数据库,未处理的“System.InvalidOperationException”类型的异常出现在 system.data.dll 中 10
其他信息:提供程序无法确定Double值。例如,该行刚刚创建,未提供Double列的默认值,并且使用者尚未设置新Double值。附以下代码高手帮忙看看,谢谢!usingS...
其他信息: 提供程序无法确定 Double 值。例如,该行刚刚创建,未提供 Double 列的默认值,并且使用者尚未设置新 Double 值。附以下代码高手帮忙看看,谢谢!
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace StoreMIS
public class Store : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Label label1;
private System.ComponentModel.Container components = null;
private OleDbConnection oleConnection1 = null;
private OleDbCommand oleCommand1 = null;
public Store()
{
InitializeComponent();
this.oleConnection1 = new OleDbConnection(StoreMIS.database.dbConnection.connection);
this.oleCommand1 = new OleDbCommand();
this.oleCommand1.Connection = this.oleConnection1;
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
DataSet ds;
private void Store_Load(object sender, System.EventArgs e)
{
oleConnection1.Open();
string sql ="select materialinfo.MID as物资编号,MName as 物资名称,MModel as 物资型号,Mtype as 类型,MUnit as 单位,"+
"InAccount-OutAccount as 剩余数量,InPrice as 单价,InValue-OutValue as 金额,InStore as 仓库,ininfo.Remark as 备注"+
" from materialinfo,ininfo,outinfo where materialinfo.MID = ininfo.MID and materialinfo.MID = outinfo.MID";
OleDbDataAdapter adp = new OleDbDataAdapter(sql,oleConnection1);
ds=new DataSet();
ds.Clear();
adp.Fill(ds,"store");
dataGrid1.DataSource=ds.Tables[0].DefaultView;
dataGrid1.CaptionText="共有"+ds.Tables[0].Rows.Count+"条记录";
oleConnection1.Close();
}
}
} 展开
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace StoreMIS
public class Store : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Label label1;
private System.ComponentModel.Container components = null;
private OleDbConnection oleConnection1 = null;
private OleDbCommand oleCommand1 = null;
public Store()
{
InitializeComponent();
this.oleConnection1 = new OleDbConnection(StoreMIS.database.dbConnection.connection);
this.oleCommand1 = new OleDbCommand();
this.oleCommand1.Connection = this.oleConnection1;
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
DataSet ds;
private void Store_Load(object sender, System.EventArgs e)
{
oleConnection1.Open();
string sql ="select materialinfo.MID as物资编号,MName as 物资名称,MModel as 物资型号,Mtype as 类型,MUnit as 单位,"+
"InAccount-OutAccount as 剩余数量,InPrice as 单价,InValue-OutValue as 金额,InStore as 仓库,ininfo.Remark as 备注"+
" from materialinfo,ininfo,outinfo where materialinfo.MID = ininfo.MID and materialinfo.MID = outinfo.MID";
OleDbDataAdapter adp = new OleDbDataAdapter(sql,oleConnection1);
ds=new DataSet();
ds.Clear();
adp.Fill(ds,"store");
dataGrid1.DataSource=ds.Tables[0].DefaultView;
dataGrid1.CaptionText="共有"+ds.Tables[0].Rows.Count+"条记录";
oleConnection1.Close();
}
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询