C# with Connecting to Oracle using ODP.NET for Review
What can be improved imin my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
As the most "dangerous" thing I see the ugly string statmentstatement for database query.
I dont want to use Entity Framework for Oracle - cause its not as actual as one for MS SQL Server. And also some Oracle features are not supprotedsupported.
C# with Oracle ODP.NET for Review
What can be improved im my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
As the most "dangerous" thing I see the ugly string statment for database query.
I dont want to use Entity Framework for Oracle - cause its not as actual as one for MS SQL Server. And also some Oracle features are not supproted.
Connecting to Oracle using ODP.NET
What can be improved in my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
As the most "dangerous" thing I see the ugly string statement for database query.
I dont want to use Entity Framework for Oracle - cause its not as actual as one for MS SQL Server. And also some Oracle features are not supported.
C# with Oracle ODP.NET. CommandText alternatives for Review
Is there any alternatives to write oracleCommand.CommandText
as a text?
This isWhat can be improved im my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
As the most "dangerous" thing I see the ugly string statment for database query.
I dont want to use Entity Framework for Oracle - cause its not as actual as one for MS SQL Server. And also some Oracle features are not supproted.
C# with Oracle ODP.NET. CommandText alternatives
Is there any alternatives to write oracleCommand.CommandText
as a text?
This is my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
C# with Oracle ODP.NET for Review
What can be improved im my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
As the most "dangerous" thing I see the ugly string statment for database query.
I dont want to use Entity Framework for Oracle - cause its not as actual as one for MS SQL Server. And also some Oracle features are not supproted.
Is there any alternatives to write oracleCommand.CommandText
as a text?
This is my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText = (
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000;1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
Is there any alternatives to write oracleCommand.CommandText
as a text?
This is my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText = (
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000;
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}
Is there any alternatives to write oracleCommand.CommandText
as a text?
This is my code:
using (var oracleConnection = new OracleConnection(ConnectionString))
{
using (var oracleCommand = oracleConnection.CreateCommand())
{
oracleConnection.Open();
oracleCommand.CommandText =
"SELECT *
FROM table_sample Table_Sample
WHERE table_sample.id > 1000";
using (var reader = oracleCommand.ExecuteReader())
{
while (reader.Read())
{
int id = reader.GetValue(0);
}
}
}
}