Skip to main content
Code Review

Return to Question

added 1 character in body; edited title
Source Link
BCdotWEB
  • 11.4k
  • 2
  • 28
  • 45

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.

added 176 characters in body; edited title
Source Link
MikroDel
  • 415
  • 1
  • 5
  • 21

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.

Notice removed Content dispute by Community Bot
Post Unlocked by Community Bot
Post Locked by Jamal
Notice added Content dispute by Jamal
edited body
Source Link
MikroDel
  • 415
  • 1
  • 5
  • 21

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);
 }
 }
 }
 }
Source Link
MikroDel
  • 415
  • 1
  • 5
  • 21
Loading
default

AltStyle によって変換されたページ (->オリジナル) /