c# 操作数据库

来源:互联网 发布:公积金管理系统uc矩阵 编辑:程序博客网 时间:2024/06/10 13:59
c#操作数据库的主程序
using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsFormsApplication2{    static class Program    {        /// <summary>        /// 应用程序的主入口点。        /// </summary>        [STAThread]        static void Main()        {            Application.EnableVisualStyles();            Application.SetCompatibleTextRenderingDefault(false);            try            {                SqlManage.cnn = new SqlConnection(SqlManage.connstring);                SqlManage.cnn.Open();            }            catch(Exception ex)            {                MessageBox.Show(ex.Message);                Application.Exit();                return;            }            Application.Run(new Form3());            SqlManage.cnn.Close();        }    }    }

0 0
原创粉丝点击