Jobs
Author: Gehan Fernando. Date Submitted: 7/18/2007 Category: Database Compatibility: .NET This code has been accessed 4908 times.
Email Yourself this snippet:
Imports System.Data.OracleClient
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Cursor = Cursors.WaitCursor If oracon Is Nothing Then oracon = New OracleClient.OracleConnection("Data Source=DATASERVER;Persist Security Info=True;User ID=USERNAME;PWD=PASSWORD;Unicode=True") End If If oracon.State = ConnectionState.Closed Then oracon.Open() MessageBox.Show("Oracle Connection Is Now Avalilabe") Me.Cursor = Cursors.Default Exit Sub End If If oracon.State = ConnectionState.Open Then MessageBox.Show("Oracle Connection Already Open No Need To Open Again") End If Me.Cursor = Cursors.Default End Sub