using (CargoSysDbContext db = new CargoSysDbContext())
{
DataSet ds = new DataSet();
if (db.Database.Connection.State == ConnectionState.Closed)
{
db.Database.Connection.Open();
}
OracleCommand myCommand = db.Database.Connection.CreateCommand() as OracleCommand;
//System.Data.Common.DbCommand dbCommand
OracleDataAdapter myAdapter = null;
try
{
myAdapter = new OracleDataAdapter();
myAdapter.SelectCommand = myCommand;
SetCommand(myCommand, item);
myAdapter.Fill(ds, "cx");
}
catch (Exception ex)
{
throw ex;
}
finally
{
myCommand.Dispose();
myAdapter.Dispose();
}
return ds;
}
网友评论