webform 组合查询】的更多相关文章

1.组合查询(1)数据访问类 //参数1:SQL语句 参数2:哈希表public List<Users> chas(string s,Hashtable has) { List<Users> List = new List<Users>(); Users u = null; com.CommandText = s; com.Parameters.Clear(); foreach(string aa in has.Keys) { com.Parameters.Add(aa…
封转类 using System; using System.Collections.Generic; using System.Linq; using System.Web; /// <summary> /// Car 的摘要说明 /// </summary> public class Car { public int ids{get;set;} public string code{get;set;} public string name{get;set;} public st…
界面: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server…
界面: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server…
一.linq高级查 1.模糊查(包含) 1 public List<User> Select(string name) 2 { 3 return con.User.Where(r =>r.UserName.Contains(name)).ToList(); 4 } 2.查开头 public List<User> Select(string name) { return con.User.Where(r => r.UserName.StartsWith(name)).To…
1.封装实体类 2.写查询方法 //SubjectData类 public List<Subject> Select(string name) { List<Subject> list = new List<Subject>(); cmd.CommandText = "select *from Subject where SubjectName like @a "; cmd.Parameters.Clear(); cmd.Parameters.Add…
一个简单的分页组合查询页面 /// <summary> /// 查询方法 /// </summary> /// <param name="tsql">SQL语句</param> /// <param name="hh">哈希表</param> /// <returns></returns> public List<Goods> Select(string un…
一.分页 1.写查询方法: public List<Student> Select(int PageCount, int PageNumber) {//PageCount为每页显示条数,PageNumber为当前第几页 List<Student> list = new List<Student>(); cmd.CommandText = ))+" Code from Student)"; conn.Open(); SqlDataReader dr =…
组合查询 protected void Button1_Click(object sender, EventArgs e) { //默认查询所有,返回的是Table类型,转换成IQueryAble类型. var query1 = this._Contex.car.AsQueryable(); var query2 = this._Contex.car.AsQueryable(); var query3 = this._Contex.car.AsQueryable(); //进一步判断查询,根据输…
1.封装实体类 2.写查询方法 //SubjectData类 public List<Subject> Select(string name) { List<Subject> list = new List<Subject>(); cmd.CommandText = "select *from Subject where SubjectName like @a "; cmd.Parameters.Clear(); cmd.Parameters.Add…