数据库的创建和sql语句增删改查 1. 载入驱动. 2. 连接数据库. 3. 操作数据库. 创建表: create table person( _id integer primary key, name varchar(20), age integer ); 加入: insert into person(name, age) values('lisi', 19); 删除: delete from person where _id = 1; 改动: update person set name =
全名:LinQ to sql类:集成化的数据访问类.会自动生成,进行数据库数据访问. LinQ的创建: 1.链接数据库:添加--添加新项--找到LINQ to SQL类--名字就叫数据库的名称就好. 2.实例化:找到连接到的数据库,要操作的表拖进来就行了. 3.操作数据库:直接添加类,名称写操作的表名就可以. 以下是各个操作: 一.查询所有 和 条件查询 public class UsersDA { Data0617DataContext con = new Data0617DataContex
/*例子 判断规则 http://xxx.xxx/new.php?id=57 and 1=1 正确 http://xxx.xxx/new.php?id=57 and 1=2 错误 http://xxx.xxx/new.php?id=57 and 2-1=1 正确 http://xxx.xxx/new.php?id=57 and 2-1=2 错误 http://xxx.xxx/new.php?id=57 and a=a 正确 http://xxx.xxx/new.php?id=57 and 'a'
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { //创建数据库实体 ModelStudentContainer DemoDB = new ModelStudentContainer(); #region 增加数据