Solved

convert from vb to c#

Posted on 2006-11-02
3
203 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

717 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