using System.Data;using System.Data.SqlClient;//先打开两个类库文件SqlConnection con = new SqlConnection(); // con.ConnectionString = "server=505-03;database=ttt;user=sa;pwd=123";con.ConnectionString = "server=.;database=stu;uid=sa;pwd=sa";con.O…
select*from shuiguo 查询表 且小于等于7的范围) select distinct name from shuiguo--去除重复,只针对一列 select * from shuiguo where name='苹果' and chandi='海南' select * from shuiguo where name in('苹果','香蕉')--name只包含苹果,香蕉的 select * from shuiguo where name not in('苹果','香蕉')--…
这里MVC中用到了反射,工厂,泛型,接口 在搭建框架的时候,除了MVC的三层以外,还有泛型的接口层和工厂层 下面是dal层调用sql存储过程,增删改查,dal层继承了接口层,实现了接口层里面的方法 1 namespace DAL 2 { 3 public class DalHouse : IHouse 4 { 5 public int Add(HouseInfo m) 6 { 7 string sql = "pro_add"; 8 SqlParameter eid = new SqlP…
根据数据库Schema限制用户对数据库的操作行为 授予Shema dbo下对象的定义权限给某个用户(也就是说该用户可以修改架构dbo下所有表/视图/存储过程/函数的结构) use [Your DB NAME] GRANT VIEW DEFINITION ON SCHEMA :: dbo to [THE USER NAME] 回收某个用户对Shema dbo下对象的定义权限(也就是说该用户不可以修改架构dbo下所有表/视图/存储过程/函数的结构) use [Your DB NAME] DENY V…