Click here to Skip to main content
15,894,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to use Enter key to Select an Option without using a Mouse Pin
SHatchard24-Oct-07 3:01
SHatchard24-Oct-07 3:01 
GeneralRe: How to use Enter key to Select an Option without using a Mouse Pin
The ANZAC24-Oct-07 3:06
The ANZAC24-Oct-07 3:06 
AnswerRe: How to use Enter key to Select an Option without using a Mouse [modified] Pin
Vimalsoft(Pty) Ltd24-Oct-07 3:37
professionalVimalsoft(Pty) Ltd24-Oct-07 3:37 
QuestionNeed a New Tool Bar Pin
kolag24-Oct-07 1:49
kolag24-Oct-07 1:49 
AnswerRe: Need a New Tool Bar Pin
The ANZAC24-Oct-07 2:52
The ANZAC24-Oct-07 2:52 
GeneralRe: Need a New Tool Bar Pin
kolag28-Oct-07 22:24
kolag28-Oct-07 22:24 
GeneralRe: Need a New Tool Bar Pin
The ANZAC28-Oct-07 23:27
The ANZAC28-Oct-07 23:27 
Questionconnect to database oracle with VB.Net 2003 Pin
kendo1724-Oct-07 1:32
kendo1724-Oct-07 1:32 
I am trying to connect to oracle database with the following code in VB.net 2003, but i am not getting anything coming back and dont know what is happening as the catch is not showing any errors the program just keeps running. I have this code behind a button should this code be in form view or elsewhere.


Imports System<br />
Imports System.Data<br />
Imports Oracle.DataAccess.Client<br />
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
<br />
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''<br />
        ' Create the connection object<br />
        Dim con As OracleConnection = New OracleConnection<br />
<br />
        ' Specify the connect string<br />
        ' NOTE: Modify User Id, Password, Data Source as per your database set up<br />
<br />
<br />
        con.ConnectionString = "User Id=user_id;Password=user_pword;Data Source=ora9idb;"<br />
<br />
<br />
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''<br />
        Try<br />
            ' Open the connection through ODP.Net<br />
            con.Open()<br />
            Console.WriteLine("Connection to Oracle database established successfully !")<br />
            Console.WriteLine(" ")<br />
<br />
<br />
        Catch ex As Exception<br />
<br />
            Console.WriteLine(ex.Message)<br />
            'txtStatus.Text &= ex.ToString<br />
        End Try<br />
        ''''''''''''''''''''''''''''''''''''''''''''''''<br />
        'Create command object to perform a query against the database<br />
        Dim cmdQuery As String = "SELECT empno, ename FROM emptab"<br />
<br />
        ' Create the OracleCommand object<br />
        Dim cmd As OracleCommand = New OracleCommand(cmdQuery)<br />
        cmd.Connection = con<br />
        cmd.CommandType = CommandType.Text<br />
<br />
<br />
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''<br />
        'Fetch data into an OracleDataReader object and <br />
        'display the data on the console. Then, close the connection object<br />
<br />
        Try<br />
<br />
<br />
<br />
            ' Execute command, create OracleDataReader object<br />
            Dim reader As OracleDataReader = cmd.ExecuteReader()<br />
            While (reader.Read())<br />
<br />
                ' Output Employee Name and Number<br />
                Console.WriteLine("Employee Number : " & _<br />
                                  reader.GetDecimal(0) & _<br />
                                                 " , " & _<br />
                                    "Employee Name : " & _<br />
                reader.GetString(1))<br />
<br />
            End While<br />
        Catch ex As Exception<br />
<br />
            Console.WriteLine(ex.Message)<br />
<br />
        Finally<br />
<br />
            ' Dispose OracleCommand object<br />
            cmd.Dispose()<br />
<br />
            ' Close and Dispose OracleConnection object<br />
            con.Close()<br />
            con.Dispose()<br />
<br />
        End Try<br />
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''<br />
<br />
    End Sub

AnswerRe: connect to database oracle with VB.Net 2003 Pin
Dave Kreskowiak24-Oct-07 6:19
mveDave Kreskowiak24-Oct-07 6:19 
GeneralRe: connect to database oracle with VB.Net 2003 Pin
kendo1724-Oct-07 7:17
kendo1724-Oct-07 7:17 
GeneralRe: connect to database oracle with VB.Net 2003 Pin
Dave Kreskowiak24-Oct-07 8:21
mveDave Kreskowiak24-Oct-07 8:21 
QuestionPopulate 2 DDL's with SQL Database Names Pin
paulray24-Oct-07 1:13
paulray24-Oct-07 1:13 
AnswerRe: Populate 2 DDL's with SQL Database Names Pin
Dave Kreskowiak24-Oct-07 6:12
mveDave Kreskowiak24-Oct-07 6:12 
Questiondatepart funtion Problem Pin
soniasan24-Oct-07 1:13
soniasan24-Oct-07 1:13 
AnswerRe: datepart funtion Problem Pin
kubben24-Oct-07 1:59
kubben24-Oct-07 1:59 
GeneralRe: datepart funtion Problem Pin
soniasan24-Oct-07 22:55
soniasan24-Oct-07 22:55 
AnswerRe: datepart funtion Problem Pin
SHatchard24-Oct-07 3:55
SHatchard24-Oct-07 3:55 
AnswerRe: datepart funtion Problem Pin
Dave Kreskowiak24-Oct-07 6:06
mveDave Kreskowiak24-Oct-07 6:06 
QuestionAdding a control button to a commandbar (In Powerpoint) Pin
chakor12324-Oct-07 0:31
chakor12324-Oct-07 0:31 
QuestionClose PDF opened by webbrowser control Pin
hanssss24-Oct-07 0:25
hanssss24-Oct-07 0:25 
AnswerRe: Close PDF opened by webbrowser control Pin
Tom Deketelaere24-Oct-07 1:24
professionalTom Deketelaere24-Oct-07 1:24 
GeneralRe: Close PDF opened by webbrowser control Pin
hanssss24-Oct-07 1:49
hanssss24-Oct-07 1:49 
QuestionHow to send mail using VB in Windows XP platform [modified] Pin
monSur hoq24-Oct-07 0:14
monSur hoq24-Oct-07 0:14 
AnswerRe: How to send mail using VB in Windows XP platform Pin
Dave Kreskowiak24-Oct-07 5:59
mveDave Kreskowiak24-Oct-07 5:59 
QuestionError Capture Pin
danasegaranea23-Oct-07 23:11
danasegaranea23-Oct-07 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.