小编m3n*_*haq的帖子

在Visual Studio中为表生成C#类代码

我的Server Explore数据库文件中有多个表.我想为表生成类的自动代码,因此所有具有属性,构造函数和getter setter方法的类都会自动生成.

请告诉我这样做的步骤.

c# class visual-studio-2010 auto-generate

4
推荐指数
1
解决办法
2万
查看次数

在打开表单之前会出现一个未知的异常

以下代码中会出现异常.你能告诉我这段代码中有什么问题吗?打开表单需要时间.在打开表单之前,将显示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)

.net c#

0
推荐指数
1
解决办法
99
查看次数

标签 统计

c# ×2

.net ×1

auto-generate ×1

class ×1

visual-studio-2010 ×1