80AND高数>80");SqlDataAdapterP_SqlDataAdapter=newSqlDataAdapter(//创建数据适配器P_Str_SqlStr,P_Str_ConnectionStr);DataTableP_dt=newDataTable();//创建数据表P_SqlDataAdapter.Fill(P_dt);//填充数据表returnP_dt;//返回数据表-IMDN开发者社群-imdn.cn"> 80AND高数>80");SqlDataAdapterP_SqlDataAdapter=newSqlDataAdapter(//创建数据适配器P_Str_SqlStr,P_Str_ConnectionStr);DataTableP_dt=newDataTable();//创建数据表P_SqlDataAdapter.Fill(P_dt);//填充数据表returnP_dt;//返回数据表 - IMDN开发者社群-imdn.cn">
登录
首页 » C#源码 » C# 利用AND运算符进行查询

C# 利用AND运算符进行查询

于 2023-08-29 发布 文件大小:13.44 kB
0 215
下载积分: 2 下载次数: 1

代码说明:

C# 利用AND运算符进行查询,查询外语成绩和高数成绩都大于80的学生信息。相关的SQL语句写法和自定义如下:   string P_Str_ConnectionStr = string.Format(//创建数据库连接字符串    @"server=WIN-GI7E47AND9RLS;database=db_TomeTwo;uid=sa;pwd=");   string P_Str_SqlStr = string.Format(//创建SQL查询字符串    "SELECT * FROM tb_Grade WHERE 外语>80 AND 高数>80");   SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter(//创建数据适配器    P_Str_SqlStr, P_Str_ConnectionStr);   DataTable P_dt = new DataTable();//创建数据表   P_SqlDataAdapter.Fill(P_dt);//填充数据表   return P_dt;//返回数据表

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

发表评论

0 个回复

  • C# 创建线程实例JoinThread
    C#创建一个基本简单的线程实例,演示了如何创建线程,面向C#新手的一个例子:   Thread myThread;//声明线程   //用线程起始点的ThreadStart委托创建该线程的实例   myThread = new Thread(new ThreadStart(createThread));   myThread.Start();//启动线程   myThread.Join();//阻止调用该线程,直到该线程终止   Console.ReadLine();
    2022-11-16 06:35:03下载
    积分:1
  • 串口调试助手
    串口调试源代码,这是我用得最多的串口调试工具,源代码用Visual c++6.0编写,代码有很好的学习参考价值,值得推荐~
    2023-05-08 10:40:03下载
    积分:1
  • 验证识别c#
    验证码识别c# 源码. 可以识别多重验证码。可以稍作修改识别更多的类型。已经使用过。可执行。 可以识别多重验证码。可以稍作修改识别更多的类型。已经使用过。可执行。
    2022-03-25 12:44:31下载
    积分:1
  • C# 浮动窗体 会跑的左右漂浮移动窗口
    C#制作的浮动窗体,动态左右漂浮移动的窗口,打开后,漂浮在其它窗口上边,由左向右漂浮移动,从截图上看不出动态漂浮移动的效果,你可以下载源码,编译运行实例即可看到,窗体漂浮移动部分的代码,如下示:   private void timer1_Tick(object sender, System.EventArgs e)   {    Point p = new Point(this.DesktopLocation.X + 1, this.DesktopLocation.Y);    this.DesktopLocation = p;    if (p.X == 550)    {    timer1.Stop();    }   }
    2023-02-27 10:00:03下载
    积分:1
  • C# 获取当前时区的标准时区名称
    C# 获取当前时区的标准时区名称:private void button1_Click(object sender, EventArgs e)   {//获取当前时区的标准时区名称    var MyInfo="当前时区的标准名称是:";    if(TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now))    MyInfo+= TimeZone.CurrentTimeZone.DaylightName;    else    MyInfo+= TimeZone.CurrentTimeZone.StandardName;    MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK);   }
    2022-04-27 18:00:04下载
    积分:1
  • IT行业资产管理系统C#+数据库
    IT行业资产管理系统C#+数据库,运行后请先登录,在登录窗口中,有验证码功能。程序主界面菜单功能:资产管理、软件设置、服务项目、资产统计报表、服务统计报表、系统设置、帮助文件。若没有登录,则软件会强制退出。也就是说,本软件需要登录后才能使用。
    2022-02-06 17:00:09下载
    积分: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# 实现简单的WPF版图片淡入淡出效果
    C# 实现简单的WPF版图片淡入淡出效果。运行本效果实例,即可看到图片淡入淡出变化,先淡入再淡出,不停的变化。
    2022-01-25 21:23:37下载
    积分:1
  • C# 按照扩展名分组文件
    C# 按照扩展名分组文件,按照文件类型的不同,对文件进行归类显示,分类清淅便于查看,主要是使用MyFile中的对象和方法实现,核心的功能代码如下:   private void ShowGroupFile(IEnumerable> MyQueryGroup)   {    this.listBox1.Items.Clear();    foreach (var MyFileGroup in MyQueryGroup)    {    this.listBox1.Items.Add("包含" + MyFileGroup.Key + "扩展名的文件如下:");    foreach (var MyFileInfo in MyFileGroup)    {    this.listBox1.Items.Add(MyFileInfo.Name);    }    this.listBox1.Items.Add("");    }   }   static IEnumerable GetFiles(string MyDir)   {    if (!System.IO.Directory.Exists(MyDir))    throw new System.IO.DirectoryNotFoundException();    string[] MyFileNames = null;    List MyFiles = new List();    //查找指定目录下的所有子目录中的所有文件    //MyFileNames = System.IO.Directory.GetFiles(MyDir, "*.*", System.IO.SearchOption.AllDirectories);    MyFileNames = System.IO.Directory.GetFiles(MyDir);    foreach (string MyName in MyFileNames)    {    MyFiles.Add(new System.IO.FileInfo(MyName));    }    return MyFiles;   }
    2022-12-28 08:15:04下载
    积分:1
  • C# 判断是否为数值
    C# 判断是否为数值,具体来说就是判断学生年龄是否为数值,private List GetStudent()   {    string P_Str_ConnectionStr = string.Format(//创建数据库连接字符串    @"server=WIN-GI7E47AND9RLS;database=db_TomeTwo;uid=sa;pwd=");    string P_Str_SqlStr = string.Format(//创建SQL查询字符串    "SELECT 学生姓名,ISNUMERIC(年龄) FROM tb_Student");    SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter(//创建数据适配器    P_Str_SqlStr, P_Str_ConnectionStr);    DataTable P_dt = new DataTable();//创建数据表    P_SqlDataAdapter.Fill(P_dt);//填充数据表    List P_str = new List();//创建数据集合    foreach (DataRow item in P_dt.Rows)    {    P_str.Add(new Instance() { 姓名=item[0].ToString(),//添加数据项    年龄 = item[1].ToString() ==    "1" ? "数值" : "非数值" });    }    return P_str;//数据集合   }
    2022-03-19 05:06:24下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载