日期:2014-05-17 浏览次数:20464 次
代码
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace Common
{
public abstract class DbHelperSQL
{
//格式化字符串
public static string inSQL(string formatStr)
{
string Str = formatStr;
if (formatStr != null && formatStr != string.Empty)
{
Str = Str.Replace("'", "''");
}
return Str;
}
//获取连接字符串
public static string ConnectionString
{
get
{
string _connectionstring = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
string ConStringEncrypt = ConfigurationManager.AppSettings["ApplicationServices"];
if (ConStringEncrypt =="true")
{
_connectionstring = DESEncrypt.Encrypt(_connectionstring);
}
return _connectionstring;
&n