摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;/* 执行简单的Insert语句 * SqlCommand表示向服务提交的一个命令(SQL语句等) * CommandText属性为要执行的sql语句,ExecuteNonQuery方法执行一个非查询语句(Update, Insert, Delete等) * using (SqlCommand cmd = conn.CreateCommand()){ * cmd Comm... 阅读全文
posted @ 2012-03-01 23:51 简单--生活 阅读(319) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;/* 连接SQLServer * 连接字符串,程序通过连接字符串指定的要连哪些台服务器上的,哪些个实例的哪些个数据库,用什么用户名密码等 * 项目内嵌mdf文件形式的连接字符串 * "Data Source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|\Database1.mdf;Integrated Security=T 阅读全文
posted @ 2012-03-01 23:51 简单--生活 阅读(349) 评论(0) 推荐(0) 编辑
简单--生活(CSDN)