日期:2014-05-17 浏览次数:20971 次
public DataTable ExecuteQuery(string sqlString)
{
using (System.Data.IDbConnection iConn = this.GetConnection())
{
//System.Data.IDbCommand iCmd = GetCommand(sqlString,iConn);
DataSet ds = new DataSet();
try
{
System.Data.IDataAdapter iAdapter = this.GetAdapater(sqlString,iConn);
iAdapter.Fill(ds);
}
catch(System.Exception e)
{
throw new Exception(e.Message);
}
finally
{
if(iConn.State != ConnectionState.Closed)
{
iConn.Close();
}
}
return ds.Tables[0];
}
}