• 大小: 0.49M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-24
  • 语言: C#
  • 标签:

资源简介


资源截图

代码片段和文件信息

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;
using System.Data.SqlClient;
using System.IO;
namespace AddDatabase
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public static SqlConnection My_con;  //定义一个SqlConnection类型的公共变量My_con,用于判断数据库是否连接成功
        public static string M_str_sqlcon = “Data Source=.;Database=CollectionEnginery;User id=sa;PWD=“;
        StreamReader SReader;

        #region  建立数据库连接
        /// 
        /// 建立数据库连接.
        /// 

        /// 返回SqlConnection对象
        public static SqlConnection getcon()
        {
            My_con = new SqlConnection(M_str_sqlcon);   //用SqlConnection对象与指定的数据库相连接
            My_con.Open();  //打开数据库连接
            return My_con;  //返回SqlConnection对象

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         923  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase.sln
     文件       13312  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase.suo
     文件        3768  2009-02-10 16:31  sj\01\AddDatabase\AddDatabase\AddDatabase.csproj
     文件        5968  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\Form1.cs
     文件        5129  2009-02-10 17:03  sj\01\AddDatabase\AddDatabase\Form1.Designer.cs
     文件        5814  2009-02-10 17:03  sj\01\AddDatabase\AddDatabase\Form1.resx
     文件         492  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase\Program.cs
     文件         195  2009-01-19 23:33  sj\01\AddDatabase\AddDatabase\bin\Debug\AddData.dat
     文件       12288  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\bin\Debug\AddDatabase.exe
     文件       28160  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\bin\Debug\AddDatabase.pdb
     文件       14328  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\bin\Debug\AddDatabase.vshost.exe
     文件         490  2007-07-21 01:33  sj\01\AddDatabase\AddDatabase\bin\Debug\AddDatabase.vshost.exe.manifest
     文件     1048576  2009-03-11 14:35  sj\01\AddDatabase\AddDatabase\database\CollectionEnginery_Data.MDF
     文件     1048576  2009-03-11 14:35  sj\01\AddDatabase\AddDatabase\database\CollectionEnginery_Log.LDF
     文件         640  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\obj\Debug\AddDatabase.csproj.FileListAbsolute.txt
     文件         847  2009-02-10 17:03  sj\01\AddDatabase\AddDatabase\obj\Debug\AddDatabase.csproj.GenerateResource.Cache
     文件       12288  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\obj\Debug\AddDatabase.exe
     文件         180  2009-02-10 17:03  sj\01\AddDatabase\AddDatabase\obj\Debug\AddDatabase.Form1.resources
     文件       28160  2009-02-10 17:04  sj\01\AddDatabase\AddDatabase\obj\Debug\AddDatabase.pdb
     文件         180  2009-02-10 16:36  sj\01\AddDatabase\AddDatabase\obj\Debug\AddDatabase.Properties.Resources.resources
     文件        1354  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase\Properties\AssemblyInfo.cs
     文件        2872  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase\Properties\Resources.Designer.cs
     文件        5612  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase\Properties\Resources.resx
     文件        1096  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase\Properties\Settings.Designer.cs
     文件         249  2009-02-10 16:28  sj\01\AddDatabase\AddDatabase\Properties\Settings.settings
     文件         944  2009-01-19 14:20  sl\CollectionEnginery\CollectionEnginery.sln
     文件       14336  2009-01-20 17:07  sl\CollectionEnginery\CollectionEnginery.suo
     文件        3747  2009-01-19 16:19  sl\CollectionEnginery\CollectionEnginery\CollectionEnginery.csproj
     文件        5106  2009-01-21 09:50  sl\CollectionEnginery\CollectionEnginery\Form1.cs
     文件        4400  2009-01-20 09:55  sl\CollectionEnginery\CollectionEnginery\Form1.Designer.cs
     文件        5814  2009-01-20 09:55  sl\CollectionEnginery\CollectionEnginery\Form1.resx
............此处省略19个文件信息

评论

共有 条评论