[sql]代码库
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
//对SQL server数据库的访问
using System.Data.SqlClient;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;database=学生成绩管理系统;uid=sa;pwd=252525";
con.Open();
if (con.State == ConnectionState.Open)
{
Console.WriteLine(con.Database);
Console.WriteLine(con.DataSource);
Console.Read();
}
con.Close();
}
}
}