C#在用VS和access数据库连接时出现一个错误无法找到表0.怎么解决啊,大神各位帮帮忙啊 10
publicvoidInitializeComponent(){this.dataGrid1=newSystem.Windows.Forms.DataGrid();thi...
public void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
this.yuangongxinxiDataSet1 = new personMIS.yuangongxinxiDataSet();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.yuangongxinxiDataSet1)).BeginInit();
this.SuspendLayout();
//
// yuangongxinxiDataSet1
//
this.yuangongxinxiDataSet1.CaseSensitive = true;
this.yuangongxinxiDataSet1.DataSetName = "yuangongxinxiDataSet";
this.yuangongxinxiDataSet1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// BrowseJob
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(400, 270);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.dataGrid1);
this.Name = "BrowseJob";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "工种种类浏览";
this.Closed += new System.EventHandler(this.BrowseJob_Closed);
this.Load += new System.EventHandler(this.BrowseSpecialtyl_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.yuangongxinxiDataSet1)).EndInit();
this.ResumeLayout(false);
}
#endregion
//定义数据集对象ds用于保存查询返回的结果集
DataSet ds;
ModifyJob modifyjob;
public void button2_Click(object sender, System.EventArgs e)
{
ds = new DataSet();
if (dataGrid1[dataGrid1.CurrentCell]!=null)
{
modifyjob=new ModifyJob();
modifyjob.Tag = ds.Tables[0].Rows[dataGrid1.CurrentRowIndex][0].ToString().Trim();
modifyjob.textBox1.Text = ds.Tables[0].Rows[dataGrid1.CurrentRowIndex][1].ToString().Trim();
modifyjob.textBox2.Text=ds.Tables[0].Rows[dataGrid1.CurrentRowIndex][2].ToString().Trim();
modifyjob.ShowDialog();
}
} 展开
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
this.yuangongxinxiDataSet1 = new personMIS.yuangongxinxiDataSet();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.yuangongxinxiDataSet1)).BeginInit();
this.SuspendLayout();
//
// yuangongxinxiDataSet1
//
this.yuangongxinxiDataSet1.CaseSensitive = true;
this.yuangongxinxiDataSet1.DataSetName = "yuangongxinxiDataSet";
this.yuangongxinxiDataSet1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// BrowseJob
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(400, 270);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.dataGrid1);
this.Name = "BrowseJob";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "工种种类浏览";
this.Closed += new System.EventHandler(this.BrowseJob_Closed);
this.Load += new System.EventHandler(this.BrowseSpecialtyl_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.yuangongxinxiDataSet1)).EndInit();
this.ResumeLayout(false);
}
#endregion
//定义数据集对象ds用于保存查询返回的结果集
DataSet ds;
ModifyJob modifyjob;
public void button2_Click(object sender, System.EventArgs e)
{
ds = new DataSet();
if (dataGrid1[dataGrid1.CurrentCell]!=null)
{
modifyjob=new ModifyJob();
modifyjob.Tag = ds.Tables[0].Rows[dataGrid1.CurrentRowIndex][0].ToString().Trim();
modifyjob.textBox1.Text = ds.Tables[0].Rows[dataGrid1.CurrentRowIndex][1].ToString().Trim();
modifyjob.textBox2.Text=ds.Tables[0].Rows[dataGrid1.CurrentRowIndex][2].ToString().Trim();
modifyjob.ShowDialog();
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询