# How can I make my question on-topic?

Connecting to Oracle using ODP.NET

I was told in the comments that it is off-topic, and someone has also downvoted it without any explanation.

I have shown code that works fine and want it reviewed. Please give your feedback.

• Thank you for addressing your concern here. I have temporarily locked your question so that further discussion can be directed here. Once a consensus is reached, please flag for unlocking. – Jamal Dec 5 '13 at 13:18
• @Jamal I have edited my queustion. Take a look at it please. Ant it can be unlocked – MikroDel Dec 5 '13 at 16:30
• It looks better now. The lock was only for an hour, hence why you were still able to edit (locks prevent all activity from non-moderators except for flagging and favoriting). Again, thank you for posting here. I'll clean up the comment section now. – Jamal Dec 5 '13 at 16:34

Entity Framework has a provider for Oracle.

Would it be a good CR answer? Certainly not. The way I read your question, it's like asking "How can I write this query in a strongly-typed manner, without those magic strings?", which is essentially asking for code to be written.

You're using using blocks to dispose your disposables, which is excellent. However these blocks increase the nesting of your code; since there's nothing between using (var oracleConnection = new OracleConnection(ConnectionString)) and using (var oracleCommand = oracleConnection.CreateCommand()) you could drop the curly braces and write it like this:

   using (var oracleConnection = new OracleConnection(ConnectionString))
using (var oracleCommand = oracleConnection.CreateCommand())
{
...
}


Within that scope, you're reassigning variable Id at each row that gets read; ultimately the value of Id will be that of the last row that was read. I doubt this is the intended behavior.

• I have edited my question. Thanks for repsonse. Upvote + accept. – MikroDel Dec 5 '13 at 16:31
• @MikroDel removed downvote on your original post :) – Mathieu Guindon Dec 5 '13 at 16:57
• @MikroDel actually, upvoted and answered! – Mathieu Guindon Dec 5 '13 at 17:06

The three current votes on your question are not suggesting it's off-topic, they are all 'It's unclear what you are asking'.

Your title and the actual question you have are a little bit contradictory too:

Title:

C# with Oracle ODP.NET. CommandText alternatives

If the title of your question was: Are there any alternatives .... ? then this would certainly be off-topic for CodeReview. As it stands at the moment, it is just unclear.