Solved

convert from vb to c#

Posted on 2006-11-02
3
198 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
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now