/// <summary>
/// Execute SQL Command,return DataSet.
/// </summary>
/// <param>SQL Command which will be Executed</param>
/// <param>SQL Parameter Collection</param>
/// <param>table name</param>
/// <returns>return DataSet.</returns>
public DataSet ExecuteSqlDs(string strSql, SqlParameter[] sqlParameters, string strTableName)
{
debug("Now Execute DataBaseAccess's Method:ExecuteSqlDs(string,SqlParameter[],string),Return Type:DataSet ");
return ExecuteSqlDs(SQLHelper.CreateCommand(strSql, sqlParameters, this.conn), strTableName);
}
#endregion
#region ExecuteSqlFillDs
/// <summary>
/// Execute SQL Command,add new resultset into current ref DataSet.
/// </summary>
/// <param>SQL Command which will be Executed</param>
/// <param>table name</param>
/// <param>current Dataset</param>
public void ExecuteSqlFillDs(SqlCommand sqlcmd, string strTableName, ref DataSet dsRef)
{
debug("Now Execute DataBaseAccess's Method:ExecuteSqlFillDs(SqlCommand,string,ref DataSet)");
sqlcmd.Connection = this.conn;
SqlDataAdapter sqlda = new SqlDataAdapter(sqlcmd);
try
{
debug("Execute SQL Command:" + sqlcmd.CommandText);
this.conn.Open();
sqlda.Fill(dsRef, strTableName);
}
catch (SqlException ex)
{
debug("Exception information:" + ex.ToString());
throw ex;
}
finally
{
sqlcmd.Dispose();
sqlda.Dispose();
this.conn.Close();
}
}