简体   繁体   中英

How to pull DataSet from Oracle in .NET?

I am a seasoned .NET / SQL Server developer. I just started a new contract where client is using Oracle, which i've no experience in.

I'm trying to create a WinForms application that will need to talk to the Oracle DB. My frst step was creating a ORacle querying API (which I normally would do in a new MS SQL based project).. I wanted to have a few methods - one such as GetDataSet which returns dataSet.. same for nonquery, scalar, etc...

Well... I can't find ExecuteDataSet inside Oracle.Client namespace. ExecuteNonQuery et al is there... but no DataSet? Can anyone help and fill me in on what I'm missing?

Greatly appreciated!

When I'm not using an ORM for Oracle work, I usually use the Enterprise Library , which has the methods you are looking for.

Database db = DatabaseFactory.CreateDatabase("connectionStringName");
DbCommand cmd = db.GetSqlStringCommand(myQuery);
// Set parameters, etc. ...
var dataset = db.ExecuteDataSet(cmd);

您可以将ODP用于.NET 更多

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM