Dal/OLEDBHelper.cs
(开头部分) 17KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using Common;
namespace Dal
{
public class OLEDBHelper
{
/// <summary>
/// 保存默认使用的数据库连接字符串
/// </summary>
private static readonly string ConnectionString = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;
//private static readonly string ConnectionString = ("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + HttpContext.Current.Server.MapPath(ConfigurationManager.ConnectionStrings["ConnString"].ToString()));
private static readonly bool isDebug = (ConfigurationManager.AppSettings["debug"].ToString()=="1");
//public static string ExeScalar(string strsql, SqlParameter[] parameter, CommandType cType)
//{
// string str = "0";
// SqlCommand sqlcmd=new SqlCommand();
// SqlConnection conn = new SqlConnection(ConnectionString);
// try
// {
// PrepareCommand(sqlcmd, conn, null, cType, strsql, parameter);
// object obj = sqlcmd.ExecuteScalar();
// sqlcmd.Parameters.Clear();
// if (!object.Equals(obj,null) && !obj.Equals(DBNull.Value))
// {
// return obj.ToString();
// }
// }
// catch(SqlException exception)
// {
// conn.Close();
// if (isDebug)
// {
// Funs.ShowErrors(exception.Message);
// return str;
// }
// Funs.ShowErrors("执行数据操作出错!");
// }
// return str;
//}
public static string ExeScalar(string strsql, SqlParameter[] parameters, CommandType cmdType)
{
string val = "0";
try
{
using (SqlConnection conn = new SqlConnection(ConnectionString))
{
SqlCommand cmd = new SqlCommand(strsql, conn) { CommandType = cmdType };
if (parameters != null)
后面还有 419 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
