摘要: //B/S模式连接数据库: string sql="Source=服务器Ip;database=数据库名称;UID=sa;Password=sasa;"; //C/S模式连接数据库: string sql="Data Source=服务器Ip;Initial Catalog=数据库名称;User I... 阅读全文
posted @ 2015-09-07 11:44 飞行在午夜 阅读(90) 评论(0) 推荐(0) 编辑
摘要: using System.Data;using System.Data.SqlClient;SqlConnection con = new SqlConnection();con.ConnectionString = "server=.;database=stu;uid=sa;pwd=sa";con... 阅读全文
posted @ 2015-09-07 11:09 飞行在午夜 阅读(178) 评论(0) 推荐(0) 编辑
摘要: DataTable dt = new DataTable(); System.Data.SqlClient.SqlConnection cnn = new Sy... 阅读全文
posted @ 2015-09-07 10:37 飞行在午夜 阅读(170) 评论(0) 推荐(0) 编辑