当前位置: 首页 > news >正文

文明网网站建设apache 多个网站

文明网网站建设,apache 多个网站,使用wordpress的建网站,天长做网站的最近在优化定时任务相关的代码#xff0c;建议是把总查询放到内存中去坐#xff0c;尽量减少打开的数据库连接 1. 内连接 指的是结果生成两张表可以连接的部分 private void button1_Click_1(object sender, EventArgs e){//初始化Student数组Student[] arrStu new Stude…最近在优化定时任务相关的代码建议是把总查询放到内存中去坐尽量减少打开的数据库连接 1. 内连接 指的是结果生成两张表可以连接的部分 private void button1_Click_1(object sender, EventArgs e){//初始化Student数组Student[] arrStu new Student[]{new Student{ID1,SNamezhangsan,Age20},new Student{ID2,SNamelisi,Age21},new Student{ID3,SNamewangwu,Age23},new Student{ID4,SNameliuliu,Age24},};//初始化Product数组Product[] arrPro new Product[]{new Product{ID1,PNameApple,Price2.25},new Product{ID2,PNameOrange,Price5.25},new Product{ID3,PNameBanana,Price7.5},new Product{ID4,PNameStrawBerry,Price6.5},};//标准查询运算符var query arrStu.Join(arrPro, s s.ID, p p.ID, (s, p) new { s.SName, s.Age, p.PName, p.Price });StringBuilder sbRes new StringBuilder();//打印foreach (var item in query){sbRes.AppendFormat(SName{0},Age{1},PName:{2},Price:{3}, item.SName, item.Age, item.PName, item.Price);sbRes.AppendLine();}MessageBox.Show(sbRes.ToString());} 或者另外一种写法 //LINQ语句var query from sItem in arrStujoin pItem in arrProon sItem.ID equals pItem.IDselect new { sItem.SName, sItem.Age, pItem.PName, pItem.Price };//Select后面接一个匿名对象 2.  分组连接 第一个集合中的每个元素与第二个集合中的一组相关元素进行配对 使用 into关键词 Person magnus new(FirstName: Magnus, LastName: Hedlund); Person terry new(Terry, Adams); Person charlotte new(Charlotte, Weiss); Person arlene new(Arlene, Huff);ListPerson people new() { magnus, terry, charlotte, arlene };ListPet pets new() {new(Name: Barley, Owner: terry),new(Boots, terry),new(Whiskers, charlotte),new(Blue Moon, terry),new(Daisy, magnus), };// Create a list where each element is an anonymous type // that contains the persons first name and a collection of // pets that are owned by them. var query from person in peoplejoin pet in pets on person equals pet.Owner into gjselect new{OwnerName person.FirstName,Pets gj};foreach (var v in query) {// Output the owners name.Console.WriteLine(${v.OwnerName}:);// Output each of the owners pets names.foreach (var pet in v.Pets){Console.WriteLine($ {pet.Name});} }/* Output:Magnus:DaisyTerry:BarleyBootsBlue MoonCharlotte:WhiskersArlene:*/ 3. 左外连接 简单理解就是基于第一张表无论第二章表是否有匹配项都放进去 左连接的数据 一定 大于等于 内连接 Person magnus new(Magnus, Hedlund); Person terry new(Terry, Adams); Person charlotte new(Charlotte, Weiss); Person arlene new(Arlene, Huff);Pet barley new(Barley, terry); Pet boots new(Boots, terry); Pet whiskers new(Whiskers, charlotte); Pet bluemoon new(Blue Moon, terry); Pet daisy new(Daisy, magnus);// Create two lists. ListPerson people new() { magnus, terry, charlotte, arlene }; ListPet pets new() { barley, boots, whiskers, bluemoon, daisy };var query from person in peoplejoin pet in pets on person equals pet.Owner into gjfrom subpet in gj.DefaultIfEmpty()select new{person.FirstName,PetName subpet?.Name ?? string.Empty};foreach (var v in query) {Console.WriteLine(${v.FirstName :,-15}{v.PetName}); }record class Person(string FirstName, string LastName); record class Pet(string Name, Person Owner);// This code produces the following output: // // Magnus: Daisy // Terry: Barley // Terry: Boots // Terry: Blue Moon // Charlotte: Whiskers // Arlene: reference 1. 执行左外部联接C# 中的 LINQ - C# | Microsoft Learn
http://www.pierceye.com/news/360996/

相关文章:

  • 顺德建设网站公司分发平台
  • 个人门户网站模板下载婚纱摄影网站定制
  • 提高网站流量的软文案例手机腾讯网
  • 网站只做内容 不做外链深圳宝安区天气
  • 生物网站 template淘宝的网站建设怎么建
  • 苏州哪家做网站好些推广之家app
  • 网站开发计入管理费用哪个明细对网站建设的调研报告
  • 南头专业的网站建设公司wordpress数据量大网站访问
  • 龙华民治网站建设公司wordpress设置vip
  • 网站建设天猫店免费主机空间
  • 帮网贷做网站会判刑吗学it要多久多少学费
  • 陕西网站建设维护erp软件怎么安装
  • 沈阳网站建设简维软件工程在网站建设
  • 万维网网站续费云南建设厅网站执业注册
  • 判断网站首页民宿设计网站大全
  • .net如何建设网站做影视会员网站
  • 织梦网站安全免费咨询医生皮肤科专家
  • dw做网站背景图片设置网站建设设计作品怎么写
  • 网站建设推广专员岗位职责济南做企业网站公司
  • 网站不备案能解析吗合肥网站推广 公司哪家好
  • 网站描述怎样写深圳网站制作招聘
  • 二手车网站建设代理网页 国外
  • 广州制作网站静态网站首页更新
  • 个人网站用什么服务器宁波网站建设制作哪家好
  • 视频模板网站企业所得税优惠政策2022年
  • 坪山附近公司做网站建设哪家效益快wordpress 置顶 插件
  • 品牌网站建设服务机构内容网站管理系统
  • 电商网站建设基础ppt个人简单网站页
  • 移动端网站模板专业建站工作室
  • 企业网站建设的重要性及意义建设银行忘记密码网站首页