本文转自:http://www.cnblogs.com/lhking/archive/2009/06/08/1499002.html 提供把Excel里的数据导入到SQL Server 数据库,前提是Excel里的字段在Sql Server表里都有,不然会出现错误.注释很详细哦!要引用的命名空间是:using System.Data.OleDb;using System.Data.SqlClient; public class ExcelToSQL { //string SqlConnectio…
转自(http://blog.163.com/jlj_sk/blog/static/22579293200861422833924/) 取得SQL server 数据库中 所有用户表名称 select name from sysobjects where xtype='U' order by name SQL server数据库系统表详解: sysaltfiles 主数据库 保存数据库的文件 syscharsets 主数据库字符集与排序顺序 sysconfigures主数据库 配置选项 sysc…
在C#的学习中,操作数据库是比较常用的技术,而access和sql server 数据库的操作却有着不同.那么,有哪些不同呢? 首先,需要引用不同的类.因为有着不同的数据引擎. access:using System.Data.OleDb; sql server:using System.Data.SqlClient; 下面是我写的access和sql 数据库操作的两个类: //1.操作sql数据库的类 public class DBOperSQL1 { public static string…
对于SQL SERFVER数据库也学了有一阵子了,自己也对自己所学做了一些总结. 我们首先学习数据库设计的一些知识点和用SQL语句建库. 设计数据库步骤:需求分析阶段,概要设计阶段,详细设计阶段, 建数据库的SQL语句如下(包含了如果有该数据库先删除在建立数据库) use masterGOif exists(select * from sysdatabases where name='Wages')DROP database WagesCREATE DATABASE Wages ON ( NA…
我们今天主要向大家讲述的是SQL Server数据库之向SQL Server自增字段正确的插入值的实际操作步骤,在一般的情况下,我们不能向 SQL Server 数据库自增字段中插入值,如果非要这么干的话,SQL Server 就会好不客气地给你个错误警告: Server: Msg 544, Level 16, State 1, Line 1 Cannot insert explicit value for identity column in table 't' when identity_i…
1.在用windows模式登陆sql server 数据库 简历一个student的数据库,然后新建查询: create table student ( id int auto_increment primary key, name ) not null, sex ) not null, age ) not null, ) 2.在vs中新建一个项目,输入一下代码: using System; using System.Collections.Generic; using System.Linq;…
今天是在吾索实习的第16天.我自己主要学习了基于MVC框架的系统的开发时,对SQL Server数据库的相关访问.其步骤如下: 第一步,在Models文件夹中创建一个类,并命名为Movies.cs,如图1所示: 图1 第二步,在上述Movies.cs文件中的namespace MvcTest.Models{}中输入如下代码: public class Movie { public int ID { get; set; } public string Title { get; set; } pub…
C#同步SQL Server数据库中的数据 1. 先写个sql处理类: using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Text; namespace PinkDatabaseSync { class DBUtility : IDisposable { private string Server; private string…