社区
C#
帖子详情
求c/s模式下 C#编程数据链接类 :用微软的sqlhelper类编写的
billlyh
2005-07-14 05:18:18
用微软的sqlhelper类编写的,通过此类对数据库增删改,发到论坛或我邮箱billlyh@163.com
100分回送!!!!!!!!!!!!1
...全文
161
1
打赏
收藏
求c/s模式下 C#编程数据链接类 :用微软的sqlhelper类编写的
用微软的sqlhelper类编写的,通过此类对数据库增删改,发到论坛或我邮箱billlyh@163.com 100分回送!!!!!!!!!!!!1
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
thinkingforever
2005-07-14
打赏
举报
回复
public void update_AQ_SafetyEvaluate(DataSet ds)
{
this.sqlConnection = new System.Data.SqlClient.SqlConnection();
this.sqlConnection.ConnectionString=strConn;
this.sqlConnection.Open();
this.sqlInsertCommand = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand = new System.Data.SqlClient.SqlCommand();
this.sqlDeleteCommand = new System.Data.SqlClient.SqlCommand();
try
{
//
// sqlInsertCommand
//
this.sqlInsertCommand.CommandText = @"INSERT INTO AQ_SafetyEvaluate(Date, ConstructLoc, MorSafetyValue, MinSafetyValue, NiSafetyValue, ExistProblem, DepNo) VALUES (@Date, @ConstructLoc, @MorSafetyValue, @MinSafetyValue, @NiSafetyValue, @ExistProblem, @DepNo)";
this.sqlInsertCommand.Connection = this.sqlConnection;
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Date", System.Data.SqlDbType.DateTime, 8, "Date"));
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ConstructLoc", System.Data.SqlDbType.VarChar, 100, "ConstructLoc"));
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MorSafetyValue", System.Data.SqlDbType.Float, 8, "MorSafetyValue"));
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MinSafetyValue", System.Data.SqlDbType.Float, 8, "MinSafetyValue"));
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NiSafetyValue", System.Data.SqlDbType.Float, 8, "NiSafetyValue"));
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ExistProblem", System.Data.SqlDbType.VarChar, 100, "ExistProblem"));
this.sqlInsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@DepNo", System.Data.SqlDbType.VarChar, 10, "DepNo"));
//
// sqlUpdateCommand
//
this.sqlUpdateCommand.CommandText = @"UPDATE AQ_SafetyEvaluate SET Date = @Date, ConstructLoc = @ConstructLoc, MorSafetyValue = @MorSafetyValue, MinSafetyValue = @MinSafetyValue, NiSafetyValue = @NiSafetyValue, ExistProblem = @ExistProblem, DepNo = @DepNo WHERE (ID = @Original_ID)";
this.sqlUpdateCommand.Connection = this.sqlConnection;
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Date", System.Data.SqlDbType.DateTime, 8, "Date"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ConstructLoc", System.Data.SqlDbType.VarChar, 100, "ConstructLoc"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MorSafetyValue", System.Data.SqlDbType.Float, 8, "MorSafetyValue"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MinSafetyValue", System.Data.SqlDbType.Float, 8, "MinSafetyValue"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NiSafetyValue", System.Data.SqlDbType.Float, 8, "NiSafetyValue"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ExistProblem", System.Data.SqlDbType.VarChar, 100, "ExistProblem"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@DepNo", System.Data.SqlDbType.VarChar, 10, "DepNo"));
this.sqlUpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
//
// sqlDeleteCommand
//
this.sqlDeleteCommand.CommandText = @"DELETE FROM AQ_SafetyEvaluate WHERE (ID = @Original_ID)";
this.sqlDeleteCommand.Connection = this.sqlConnection;
this.sqlDeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
SqlHelper.UpdateDataset(this.sqlInsertCommand,this.sqlDeleteCommand,this.sqlUpdateCommand,ds,ds.Tables[0].TableName);
}
catch(Exception ex)
{
finally
{
this.sqlConnection.Close();
}
}
c#
,VB
SQL
Helper
数据
库
类
完整的 Visual
C#
和 Visual Basic .NET 源代码
c#
,VB
SQL
Helper
数据
库
类
使用
Sql
Helper
增加
数据
库记录
编程
小实例,C++.net源代码
编写
使用
Sql
Helper
增加
数据
库记录
编程
小实例,C++.net源代码
编写
C#
SQL
SERVER
数据
库操作
类
C#
实现
SQL
SERVER
数据
库操作
类
,很方便的使用的。
SQL
Helper
.dll
微软
难得的原码。包含
C#
与VB写的
SQL
Helper
.dll
C#
基
类
整理
我收集的
C#
基
类
,比较全.我收集的
C#
基
类
,比较全. 包含有: ASP.NET
类
库
C#
读取AD域里用户名或组 Common
类
库 DotNet基础
类
大全
Sql
Helper
基
类
字符串加密
C#
111,125
社区成员
642,540
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章