设为首页 加入收藏

TOP

[C#]分享一个以前的项目使用的DataBaseAccess类(九)
2014-11-24 14:34:34 来源: 作者: 【 】 浏览:12
Tags:分享 一个 以前 项目 使用 DataBaseAccess
SqlParameter)((ICloneable)sqlParameters[i]).Clone();
}


return clonedParms;
}


//----------------------------------------------------------------------------------------------------------------


///


/// Create new SqlComand
///

///
public static SqlCommand CreateCommand(string strSql)
{
SqlCommand sqlcmd = new SqlCommand(strSql);
return sqlcmd;
}


///


/// Create new SqlComand,Set DataBase Connection
///

///
///
///


public static SqlCommand CreateCommand(string strSql, SqlConnection sqlconn)
{
SqlCommand sqlcmd = new SqlCommand(strSql, sqlconn);
return sqlcmd;
}



///


/// Create new SqlComand which has Parameters
///

///
///
public static SqlCommand CreateCommand(string strSql, SqlParameter[] sqlParameters)
{
SqlCommand sqlcmd = new SqlCommand(strSql);
foreach (SqlParameter param in sqlParameters)
{
sqlcmd.Parameters.Add(param);
}
return sqlcmd;
}


///


/// Create new SqlComand which has Parameters,Set DataBase Connection
///

///
///
///
public static SqlCommand CreateCommand(string strSql, SqlParameter[] sqlParameters, SqlConnection sqlconn)
{
SqlCommand sqlcmd = new SqlCommand(strSql, sqlconn);
foreach (SqlParameter param in sqlParameters)
{
sqlcmd.Parameters.Add(param);
}
return sqlcmd;
}


///


/// Create new SqlComand which has Parameters,Set Stored Procedure Flag
///

///
///
///
///
public static SqlCommand CreateCommand(string strSql, SqlParameter[] sqlParameters, bool bIsStoredProcedure)
{
SqlCommand sqlcmd = new SqlCommand(strSql);


if (bIsStoredProcedure)
sqlcmd.CommandType = CommandType.StoredProcedure;
else
sqlcmd.CommandType = CommandType.Text;


foreach (SqlParameter param in sqlParameters)
{
sqlcmd.Parameters.Add(param);
}
return sqlcmd;
}


///


/// Create new SqlComand which has Parameters,Set Stored Procedure Flag and DataBase Connection
///

///
///
///
///
public static SqlCommand CreateCommand(string strSql, SqlParameter[] sqlParameters, bool bIsStoredProcedure, SqlConnection sqlconn)
{
SqlCommand sqlcmd = new SqlCommand(strSql, sqlconn);


if (bIsStoredProcedure)
sqlcmd.CommandType = CommandType.StoredProcedure;
else
sqlcmd.CommandType = CommandType.Text;


foreach (SqlParameter param in sqlParameters)
{
sqlcmd.Parameters.Add(param);
}
return sqlcmd;
}


///


/// Create new SqlDataAdapter which has Parameters and set DataBase Connection
///

///
///
public static SqlDataAdapter CreateDataAdapter(string strSql,
首页 上一页 6 7 8 9 10 下一页 尾页 9/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C# 在winform画面上点击某个区域.. 下一篇C#中生成验证码的类

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: