Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

convert from vb to c#

Posted on 2006-11-02
3
Medium Priority
?
206 Views
Last Modified: 2010-04-16
I have the following simple vb code.  How to convert to c#?  Thanks.
 
        Dim conn = New OracleConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"))
        Dim CMD = New OracleCommand
        Dim da = New OracleClient.OracleDataAdapter(CMD)
        Dim ds = New DataSet

        CMD.Connection = conn
        conn.Open()

        CMD.CommandTEXT = "MY_PROC"

        CMD.Parameters.Add("in_psr_type", OracleType.VarChar)
        CMD.Parameters("in_psr_type").Value = Request.QueryString("in_type")

        CMD.CommandType = CommandType.StoredProcedure

        da.SelectCommand = CMD
        da.Fill(ds, "ContactRequests")

        conn.Close()
0
Comment
Question by:ewang1205
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 17861374
OracleConnection conn = new OracleConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"));
OracleCommand CMD = new OracleCommand();
OracleClient.OracleDataAdapter da = new OracleClient.OracleDataAdapter(CMD);
DataSet ds = new DataSet();

CMD.Connection = conn;
conn.Open();

CMD.CommandText = "MY_PROC";

CMD.Parameters.Add("in_psr_type", OracleType.VarChar);
CMD.Parameters["in_psr_type"].Value = Request.Querystring["in_type"];

CMD.CommandType = CommandType.StoredProcedure;

da.SelectCommand = CMD;
da.Fill(ds, "ContactRequests");

conn.Close();
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17861455
       OracleConnection conn = new OracleConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"));
                  OracleCommand CMD = new OracleCommand();
                  OracleDataAdapter da = new OracleDataAdapter(CMD);
                  DataSet ds = new DataSet();

                  CMD.Connection = conn;
                  conn.Open();

                  CMD.CommandText = "MY_PROC";

                  CMD.Parameters.Add("in_psr_type", OracleType.VarChar);
                  CMD.Parameters["in_psr_type"].Value = Request.QueryString("in_type");

                  CMD.CommandType = CommandType.StoredProcedure;

                  da.SelectCommand = CMD;
                  da.Fill(ds, "ContactRequests");

                  conn.Close();
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17861456
doh!
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question