登录
首页 » C#源码 » C# 在LINQ to DataSet中对分组操作执行子查询

C# 在LINQ to DataSet中对分组操作执行子查询

于 2022-01-27 发布 文件大小:12.89 kB
0 10136
下载积分: 2 下载次数: 1

代码说明:

C# 在LINQ to DataSet中对分组操作执行子查询,相关代码:   private void button1_Click(object sender, EventArgs e)   {//在LINQ to DataSet中对分组操作执行子查询    SqlConnection MyConnection = new SqlConnection();    MyConnection.ConnectionString = @"Data Source =.SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";    MyConnection.Open();    SqlCommand MyCommand = new SqlCommand("Select * From Orders ", MyConnection);    DataSet MySet = new DataSet();    SqlDataAdapter MyAdapter = new SqlDataAdapter(MyCommand);    MyAdapter.Fill(MySet);    DataTable MyQueryTable = MySet.Tables[0];    var MyQuery = from MyOrder in MyQueryTable.AsEnumerable()    orderby MyOrder.Field("ShipCity")    group MyOrder by MyOrder.Field("ShipCity") into g    select new    {    MyCity = g.Key,    MyMaxFreight = (from MyData in g select MyData.Field("Freight")).Max()   

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C# 为textBox文本框控件添加颜色光环
    C# 为文本框控件添加颜色光环,是不是把textBox装扮得很漂亮呢?外发光的文本框,有点沙沙的感觉,核心代码有兴趣可参考:   private void Window_Loaded(object sender, RoutedEventArgs e)   {//为文本框控件添加颜色光环    var MyOuterGlowBitmapEffect = new System.Windows.Media.Effects.OuterGlowBitmapEffect();    MyOuterGlowBitmapEffect.GlowSize = 30;    Color MyColor = new Color();    MyColor.ScA = 1;    MyColor.ScB = 1;    MyColor.ScG = 0;    MyColor.ScR = 0;    MyOuterGlowBitmapEffect.GlowColor = MyColor;    MyOuterGlowBitmapEffect.Noise = 1;    MyOuterGlowBitmapEffect.Opacity =0.8;    this.textBox1.BitmapEffect = MyOuterGlowBitmapEffect;   }   完整的C#可编译源代码,请下载本源码。
    2022-07-09 20:47:57下载
    积分:1
  • C#在线升级程序样例
    C#在线升级程序源码样例,比较简单的写法,可以借鉴一下,很实用
    2022-09-03 21:15:03下载
    积分:1
  • 一些小数 整数各种数学计算方法示例合集
    C#演示数学计算的源码,演示了一些小数 整数各种数学计算方法示例,包括了源码合集,比如设置货币小数点左边的分节号、设置数字小数点左边的分节号、对整型算术运算进行溢出检查、实现基本数据类型的任意转换、随机获取数组中的数据元素等,里面每个功能都对应一段代码,你可把这些功能片段整合到你的C#函数集中。
    2022-03-24 00:00:20下载
    积分:1
  • C# 为文字创建渐变色的下划线
    C# 为文字创建渐变色的下划线,放大后还是很漂亮的,下划线变成了点状的,而且是颜色是渐变的,下面介绍实现这一功能的代码,给字符串创建渐变色下划线,核心代码如下:   TextDecoration MyUnderline = new TextDecoration();   Pen MyPen = new Pen();   MyPen.Brush = new LinearGradientBrush(Colors.Green,    Colors.Blue, new Point(0, 0.5), new Point(1, 0.5));   MyPen.Brush.Opacity = 0.5;   MyPen.Thickness = 1.5;   MyPen.DashStyle = DashStyles.Dash;   MyUnderline.Pen = MyPen;   MyUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended;   TextDecorationCollection MyCollection = new TextDecorationCollection();   MyCollection.Add(MyUnderline);   this.textBlock1.Text = "中华人民共和国";//自定义要显示下划线的文字   this.textBlock1.FontSize = 48;   this.textBlock1.TextDecorations = MyCollection;   需要请下载完整源码。运行效果图如下。
    2022-01-22 05:14:06下载
    积分:1
  • C# 以浮雕效果显示图片
    Visual C# 以浮雕效果显示图像控件中的图像,private void Window_Loaded(object sender, RoutedEventArgs e)   {//以浮雕效果显示图像控件中的图像    var MyEmbossBitmapEffect = new System.Windows.Media.Effects.EmbossBitmapEffect();    MyEmbossBitmapEffect.LightAngle = 320;    MyEmbossBitmapEffect.Relief = 0.8;    this.image1.BitmapEffect = MyEmbossBitmapEffect;   }
    2022-05-23 11:20:57下载
    积分:1
  • C# 获取本地打印服务器后台文件的路径
    Visual C# MyWinWPF.rar,核心代码分享如下:   private void button1_Click(object sender, RoutedEventArgs e)   {//获取本地打印服务器后台文件的路径    var MyPrintServer = new System.Printing.LocalPrintServer();    string MyInfo = "本地打印服务器后台文件的路径是:" + MyPrintServer.DefaultSpoolDirectory;    MessageBox.Show(MyInfo, "信息提示", MessageBoxButton.OK);   }
    2022-01-23 11:13:33下载
    积分:1
  • 7Zip
    This file is part of SevenZipSharp.    SevenZipSharp is free software: you can redistribute it and/or modify    it under the terms of the GNU Lesser General Public License as published by    the Free Software Foundation, either version 3 of the License, or    (at your option) any later version.    SevenZipSharp is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public License    along with SevenZipSharp.  If not, see .
    2022-07-20 00:09:31下载
    积分:1
  • C# 利用聚合函数SUM对销售额进行汇总
    C# 数据库版图书销售统计,利用聚合函数SUM对销售额进行汇总,包括销售总数量、销售总金额的统计:   /// 查询图书数量及金额信息   ///
    2022-01-31 08:31:12下载
    积分:1
  • C# 文件下载器 可以进行网络爬虫资下载
    一个Visual C#2012 编写的文件下载器 可以进行网络爬虫资源下载,源文件目录介绍:   MyDownloader.Spider是网络抓取资源的下载程序。   MyDownloader.IEPlugin是在IE中下载时的一个小补丁插件。   MyDownloader.Extension是一个下载插件的扩展程序,可用于IE或其它程序环境。   MyDownloader.Core是下载程序的核心代码   MyDownloader.App一个较小的扩展出来的APP项目源码   因环境和VS版本问题,编辑在上传源码前没有测试成功,如果有版本的话,应该可以编译成功,所需的DLL组件已为你打包。
    2022-10-17 08:45:03下载
    积分:1
  • FX5U 以太网测试
    此代码是PC机以太网方式连接Fx5u通讯使用,将Mxcompent配置好后,可使用此代码联机,可以实现对PLC 的控制和信息获取,实测可以使用,每项功能都已经实测过了。请放心下载。
    2022-05-29 06:48:52下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载