-
大小: 98KB文件類型: .rar金幣: 2下載: 0 次發布日期: 2021-06-11
- 語言: 其他
- 標簽: siteserver??CMS??簽收??使用教程??
資源簡介
SiteServerCMS用戶簽收功能實現和詳細使用教程

代碼片段和文件信息
using?System;
using?System.Data;
using?System.Configuration;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.Data.Sql;
using?System.Data.SqlClient;
using?System.Text.Regularexpressions;
using?System.Collections.Generic;
///?
///?Summary?description?for?Sqlhelper
///?
public?class?Sqlhelper
{
????
????#region?
????///?
????///?保存數據庫連接字符串,字符值從config文件里讀取
????///? ????protected?static?readonly?string?sConn?=?ConfigurationManager.AppSettings[“ConnectionString“].ToString();
????#endregion
????#region?Functions
????public?Sqlhelper()
{
//
//?TODO:?Add?constructor?logic?here
//
?????
????}
????///
????///執行不返回數據集的Sql語句
????///
????public?static?int?ExecuteSql(string?strSQL)
????{
????????SqlConnection?myCn?=?new?SqlConnection(sConn);
????????SqlCommand?myCmd?=?new?SqlCommand(strSQL?myCn);
????????try
????????{
????????????myCn.Open();
????????????myCmd.ExecuteNonQuery();
????????????return?0;
????????}
????????catch?(SqlException?e)
????????{
????????????throw?new?Exception(e.Message);
????????}
????????finally
????????{
????????????myCmd.Dispose();
????????????myCn.Close();
????????}
????}
????///
????///執行SQL語句,判斷是否返回數據,不返回則拋出異常
????///
????public?static?int?ExecuteSqlEx(string?strSQL)
????{
????????SqlConnection?myCn?=?new?SqlConnection(sConn);
????????SqlCommand?myCmd?=?new?SqlCommand(strSQL?myCn);
????????try
????????{
????????????myCn.Open();
????????????SqlDataReader?myReader?=?myCmd.ExecuteReader();
????????????if?(myReader.Read())
????????????{
????????????????return?0;
????????????}
????????????else
????????????{
????????????????throw?new?Exception(“Value?Unavailable!“);
????????????}
????????}
????????catch?(SqlException?e)
????????{
????????????throw?new?Exception(e.Message);
????????}
????????finally
????????{
????????????myCmd.Dispose();
????????????myCn.Close();
????????}
????}
????///
????///執行SQL語句并返回數據集
????///
????public?static?DataSet?ExecuteSql4Ds(string?strSQL)
????{
????????SqlConnection?myCn?=?new?SqlConnection(sConn);
????????try
????????{
????????????myCn.Open();
????????????SqlDataAdapter?sda?=?new?SqlDataAdapter(strSQL?myCn);
????????????DataSet?ds?=?new?DataSet(“ds“);
????????????sda.Fill(ds);
????????????int?i?=?ds.Tables[0].Rows.Count;
????????????return?i?>?0???ds?:?null;
????????}
????????catch?(SqlException?e)
????????{
????????????throw?new?Exception(e.Message);
????????}
????????finally
????????{
????????????myCn.Close();
????????}
????}
????///
????///執行僅返回一個數字值結果的SQL語句
????///
????public?static?int?ExecuteSql4Value(string?strSQL)
????{
????????SqlConnection?myCn?=?new?SqlConnection(sConn);
????????SqlCommand?myCmd?=?new?SqlCommand(strS
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????9932??2013-04-21?18:55??SiteServerCMS用戶簽收功能實現+使用教程\App_Code\Sqlhelper.cs
?????文件???????2929??2013-04-21?21:14??SiteServerCMS用戶簽收功能實現+使用教程\signadmin\userSign.aspx
?????文件???????3457??2013-04-22?22:41??SiteServerCMS用戶簽收功能實現+使用教程\signadmin\userSign.aspx.cs
?????文件???????2923??2013-04-21?21:22??SiteServerCMS用戶簽收功能實現+使用教程\signadmin\userSigned.aspx
?????文件???????2422??2013-04-22?22:42??SiteServerCMS用戶簽收功能實現+使用教程\signadmin\userSigned.aspx.cs
?????文件???????2119??2013-04-21?22:37??SiteServerCMS用戶簽收功能實現+使用教程\signadmin\userSignview.aspx
?????文件???????5201??2013-04-21?22:40??SiteServerCMS用戶簽收功能實現+使用教程\signadmin\userSignview.aspx.cs
?????文件???????4202??2013-04-22?22:53??SiteServerCMS用戶簽收功能實現+使用教程\signfunc\signresult.ashx
?????文件?????125952??2013-05-22?16:38??SiteServerCMS用戶簽收功能實現+使用教程\簽收使用教程.doc
?????目錄??????????0??2013-05-22?15:57??SiteServerCMS用戶簽收功能實現+使用教程\App_Code
?????目錄??????????0??2013-05-09?20:33??SiteServerCMS用戶簽收功能實現+使用教程\signadmin
?????目錄??????????0??2013-05-22?15:57??SiteServerCMS用戶簽收功能實現+使用教程\signfunc
?????目錄??????????0??2013-05-22?16:38??SiteServerCMS用戶簽收功能實現+使用教程
-----------?---------??----------?-----??----
???????????????159137????????????????????13
- 上一篇:SiteServer CMS用戶簽收功能實現
- 下一篇:浮點數轉化工具
評論
共有 條評論