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;
namespace cadADO
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (SqlConnection coon = new SqlConnection(@"Server=.\SQLExpress;AttachDbFilename=G:\WPF\cadADO\cadADO\bin\Debug\Database1.mdf;Trusted_Connection=sspi;"))
{
coon.Open();
MessageBox.Show("连接成功");
}
}
}
}