我的Server Explore数据库文件中有多个表.我想为表生成类的自动代码,因此所有具有属性,构造函数和getter setter方法的类都会自动生成.
请告诉我这样做的步骤.
以下代码中会出现异常.你能告诉我这段代码中有什么问题吗?打开表单需要时间.在打开表单之前,将显示catch块中的消息框.我的数据库正在运行,但我不知道为什么它运行不顺畅?请指导......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace IMS
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
// To set up a connection object
System.Data.SqlClient.SqlConnection con;
System.Data.OleDb.OleDbDataAdapter da;
private void Form2_Load(object sender, EventArgs e)
{
con = new System.Data.SqlClient.SqlConnection();
// TODO: This line of code loads data into the 'iMSDataSet1.Part_Group'
//table. You can move, or remove it, as needed.
this.part_GroupTableAdapter.Fill(this.iMSDataSet1.Part_Group);
con.ConnectionString = "Data Source=.\\DataDirectory\\IMS.sdf;Password=ims;Persist Security …Run Code Online (Sandbox Code Playgroud)