2024年4月11日发(作者:)
using System;
using c;
using ;
using ent;
using uration;
using ;
namespace MSSQL数据库操作类
{
public class SqlServer
{
SqlConnection _con = new SqlConnection();
SqlCommand _cmd = new SqlCommand();
SqlDataAdapter _sda = new SqlDataAdapter();
public SqlServer()
:
this(tionStrings["MSSQLConStr"].ConnectionString)
{
}
public SqlServer(string connectionString)
{
this._tionString = connectionString;
this._tion = this._con;
}
public void Reset()
{
this._tion = this._con;
this._dType = ;
= ;
();
}
public void Open()
{
if (this._ == ) this._();
}
public void Close()
{
if (this._ == ) this._();
}
public CommandType CommandType
{
get
{
return this._dType;
}
set
{
this._dType = value;
}
}
public string SQL
{
get
{
return this._dText;
}
set
{
this._dText = value;
}
}
public SqlParameterCollection Parameters
{
get
{
return this._ters;
}
}
public string GetDeleteSQL(string tableName, string condition)
{
if (!OrEmpty(condition))
{
condition = " WHERE " + condition;
}
return ("DELETE FROM {0} {1}", tableName, condition);
}
//SELECT TOP 个数 fields FROM tableName WHERE 条件
public string GetSelectSQL(string table, string condition, int top, string fields, string
发布评论