Home
Options

SQL Query to DataTable in C# Statement

Hello everyone,
I have very complex SQL querys which cannot be translated to LinQ very easily with my knowledge.
Right now I use the following code to get my job done:
DataTable Table = new DataTable();

const string Server = "Server=XXXX; User ID=XXXXXXX; Password=XXXXXX";
const string sqlQuery = "SELECT * FROM XXXX";

using (OracleConnection connection = new OracleConnection(Server))
using (OracleCommand cmd = new OracleCommand(sqlQuery, connection))
using (OracleDataAdapter results = new OracleDataAdapter(cmd))
{
	connection.Open();
	results.Fill(Table);
	connection.Close();
}
Table.Dump();
Unfortunately OracleConnection is obsolete and won’t be supported in the future. I know I could use the Oracle Data Provider to be a bit more up to date… but:

My Question is:
Is it possible to use the direct Oracle Plugin in LinQPad? If so, how do I have to connect?
Thanks in advance!
Best regards,
Sebastian

Comments

Sign In or Register to comment.