SQL参数化
SqlCommand com = new SqlCommand("select * from myuser where username=@UserName and password=@Pwd", con);
com.Parameters.Add(new SqlParameter("@UserName", UserName));
com.Parameters.Add( new SqlParameter("@Pwd",Pwd));
相关文档:
设计原则
符号三大范式(每一列表达一个意思,每一行代表一个实例/每一行有唯一键/表内没有其它表的非主键信息)
每个表应该有的3个有用字段(记录创建或更新时间/记录创建者/记录版本)
避免保留字
表应避免可为空的列
命名规范
表
表名如Or ......
Linq to SQL uses a DataContext to manage it's access to the database as well as tracking changes made to entities retrieved from the database. Linq to SQL has a persistent approach to managing its 'connection' to the database via this data context and it basically assumes that you use a single Dat ......
1、在.net framework 2.0的安装目录下
(默认是WINNT\Microsoft.NET\Framework\v2.0.40607),启动一个叫ASPnet_regsql.exe的命令行工具,比如:
ASPnet_regsql -S localhost –U sa –P 123456 -d Pubs –ed
上面的意思是,指定了本地的数据库服务器localhost,并指定了登陆的用户名和密码,并用参 ......
PL/SQL块
declare
begin
--SQL语句
--直接写的SQL语句(DML/TCL)
--间接写execute immediate <DDL/DCL命令字符串>
--select 语句
<1>必须带有into子句
......
insert into Country123 ([Country_Id], [Region_ID], [Country_EN_Name], [Country], [Country_ALL_ID], [Country_Order_Id]) select [Country_Id], [Region_ID], [Country_EN_Name], [Country], [Country_ALL_ID], [Country_Order_Id] from openrowset( 'Microsoft.Jet.OLEDB.4.0', 'EXCEL 5.0;HDR=YES;IMEX=1; DATABASE= ......