-
C# 使用COMPUTE BY 统计查询数据库中各部门工资
C# COMPUTE BY数据库查询实例,本查询可用于统计各部门总工资,测试前请附加好数据库。定义以下代码完成此查询:
DataSet P_ds = GetPay();//得到数据集
txt_Pay1.Text = P_ds.Tables[1].Rows[0][0].ToString();//得到部门总工资
txt_Pay2.Text = P_ds.Tables[3].Rows[0][0].ToString();//得到部门总工资
txt_Pay3.Text = P_ds.Tables[5].Rows[0][0].ToString();//得到部门总工资
string P_Str_ConnectionStr = string.Format(//创建数据库连接字符串
@"server=LVSHUANGSHJ;database=db_TomeTwo;uid=sa;pwd=");
string P_Str_SqlStr = string.Format(//创建SQL查询字符串
"SELECT * FROM tb_Employee ORDER BY 所属部门 COMPUTE SUM(工资) BY 所属部门");//创建COMPUTE BY 查询语句
SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter(//创建数据适配器
P_Str_SqlStr, P_Str_ConnectionStr);
DataSet P_ds = new DataSet();//创建数据集
P_SqlDataAdapter.Fill(P_ds);//填充数据集
return P_ds;//返回数据集
本查询将结果返回DataTable到对象中显示,完整源代码请下载。
- 2022-02-05 08:50:14下载
- 积分:1
-
12452
在vc控制台中运行,用遗传算法求解最短路径,用邻接矩阵表示路线图。(Vc console in the run, the shortest path with the genetic algorithm, said the road map with the adjacency matrix.)
- 2011-05-08 09:16:11下载
- 积分:1
-
bishai
脑机接口比赛的相关文件。主要适用于采用bci2000的应用软件编程的朋友。对学校bci技术有一定的帮助意义(Relevant documents of BCI competition. Mainly applied to software programming applications using bci2000 friends. Bci technical schools have some help significance)
- 2014-09-04 14:05:33下载
- 积分:1
-
在C语言中自由Modbus
stm32f0103e Modbus端口的使用测试,易于使用和与其他图书馆的端口。
- 2022-07-10 09:22:01下载
- 积分:1
-
I2C.doc
说明: I2C总线驱动的C51语言源程序,这个是我们在开发中会用到的(I2C )
- 2010-04-06 15:43:38下载
- 积分:1
-
11695 - DS_2017fall_HW4
this is my data structure homework4
- 2018-01-04 02:55:30下载
- 积分:1
-
21ic下载_STM32F103 ATT7022 MODBUS工程 源程序_
ATT7022是一种多功能高精度三相电能计量专用芯片,适用于三相三线的应用。将采集到的电量参数通过本身自带的SPI串行口传输给处理器上。(ATT7022 is a multi-function and high-precision three-phase power metering special chip, which is suitable for three-phase three wire applications. The collected power parameters are transmitted to the processor through the SPI serial port.)
- 2018-11-07 11:09:47下载
- 积分:1
-
C#调用百度地图实例源码
说明: C#调用百度地图实例源码
网络搜集整理 希望对大家有所帮助(C# Call Baidu Map Instance Source
I hope that the collection and arrangement of the network will be helpful to all of you.)
- 2020-06-18 23:40:01下载
- 积分:1
-
stone
说明: 经典的石子划分问题,不同质量和数量的石子进行划分,以求最优解(Classic stone division, different quality and quantity of stones to be divided, with a view to the optimal solution)
- 2010-04-19 23:46:51下载
- 积分:1
-
按键触发延时3分钟程序
通过c语言程序实现继电器应用模块按键触发延时3分钟程序(Through the C language program to achieve Relay Application module, the trigger delay 3 minutes program)
- 2017-08-10 09:11:46下载
- 积分:1