xecute DataBaseAccess's Method:ExecScalarEx(SqlCommand),Return Type:int ");
sqlcmd.Connection = this.conn;
try
{
debug("Execute SQL Command:" + sqlcmd.CommandText);
this.conn.Open();
SqlDataReader myDr = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);
if (myDr.Read())
{
return 1;
}
else
{
return 0;
}
}
catch (SqlException ex)
{
debug("Exception Information:" + ex.ToString());
throw ex;
}
finally
{
sqlcmd.Dispose();
this.conn.Close();
}
}
///
/// Execute SQL command,if result set has note return 1,if result set is null return 0
///
/// SQL Command which will be Executed
/// Execute SQL command,if result set has note return 1,if result set is null return 0
public int ExecScalarEx(string strSql)
{
debug("Now Execute DataBaseAccess's Method:ExecScalarEx(strSql),Return Type:int ");
return ExecScalarEx(new SqlCommand(strSql, this.conn));
}
///
/// Execute SQL command,if result set has note return 1,if result set is null return 0
///
/// SQL Command which will be Executed
/// SQL Command Collection
/// Execute SQL command,if result set has note return 1,if result set is null return 0
public int ExecScalarEx(string strSql, SqlParameter[] sqlParameters)
{
debug("Now Execute DataBaseAccess's Method:ExecScalarEx(string,SqlParameter[]),Return Type:int ");
return ExecScalarEx(SQLHelper.CreateCommand(strSql, sqlParameters, this.conn));
}
#endregion
#region ExecuteSqlDs
///
/// Execute SQL Command,return DataSet.
///
/// SQL Command which will be Executed
/// table name
/// return DataSet.
public DataSet ExecuteSqlDs(SqlCommand sqlcmd, string strTableName)
{
debug("Now Execute DataBaseAccess's Method:ExecuteSqlDs(SqlCommand,string),Return Type:DataSet ");
sqlcmd.Connection = this.conn;
SqlDataAdapter sqlda = new SqlDataAdapter(sqlcmd);
DataSet dsReturn = new DataSet();
try
{
debug("Execute SQL Command:" + sqlcmd.CommandText);
this.conn.Open();
sqlda.Fill(dsReturn, strTableName);
return dsReturn;
}
catch (SqlException ex)
{
debug("Exception information:" + ex.ToString());
throw ex;
}
finally
{
sqlcmd.Dispose();
sqlda.Dispose();
this.conn.Close();
}
}
///
/// Execute SQL Command,return DataSet.
///
/// SQL Command which will be Executed
/// table name
/// return dataset.
public DataSet ExecuteSqlDs(string strSql, string strTableName)
{
debug("Now Execute DataBaseAccess's Method:Exec