App_Code/SQLHelper.cs
(开头部分) 17KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace DBUtility
{
/// <summary>
/// The SqlHelper class is intended to encapsulate high performance,
/// scalable best practices for common uses of SqlClient.
/// </summary>
public class SqlHelper
{
//Database connection strings
// Hashtable to store cached parameters
private static Hashtable parmCache = Hashtable.Synchronized(new Hashtable());
public static readonly string ConnectionStringLocalTransaction = ConfigurationManager.ConnectionStrings["NetwebConnectionString"].ConnectionString;
public static readonly string ConStr = ConfigurationManager.ConnectionStrings["NetwebConnectionString"].ConnectionString;
SqlDataReader dr;
public SqlDataReader rundr(string sql)
{
SqlConnection conn = new SqlConnection(ConStr);
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
dr = cmd.ExecuteReader();
return dr;
}
public void runsql(string sql)
{
using (SqlConnection conn = new SqlConnection(ConStr))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.ExecuteNonQuery();
conn.Close(); conn.Dispose();
}
}
public DataView exeds(string sql)
{
using (SqlConnection conn = new SqlConnection(ConStr))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
conn.Close(); conn.Dispose();
return ds.Tables[0].DefaultView;
}
后面还有 333 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。