Solved

convert from vb to c#

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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 article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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