蔡嘉 发表于 2013-2-16 13:22
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
SqlConnection conn = new SqlConnection(@"server=.;database=Database1.mdf;uid=sa;pwd=******");
楼主你这里的 database=Database1.mdf 不对吧,database是数据库,你后面跟个mdf是什么东西?
SqlConnection conn = new SqlConnection(@"Data Source=.\;Initial Catalog=Database1;User ID=sa;password=*****");
|