Está en la página 1de 1

Implements IDisposable

Private m_CN As SqlConnection


Private m_DA As SqlDataAdapter
Private m_CMD As SqlCommand
Private disposed As Boolean = False
Public ocn As SqlConnection
Const strCN As String = "SERVER=SERVIDORAPRO;Initial
Catalog=BDCOFFEE;uid=sa;pwd="
' Const strCN As String = "SERVER=SERVIDORAPRO;Initial
Catalog=BDCOFFEE;uid=sa;pwd="
#Region "Contructores de la clase"
Public Sub New()
m_CN = New SqlConnection(strCN)
End Sub
#End Region
Public Sub Connectar()
Try
ocn = New SqlConnection("SERVER=SERVIDORAPRO;Initial
Catalog=BDCOFFEE;uid=sa;pwd=")
'ocn = New SqlConnection("SERVER=SERVIDORAPRO;Initial
Catalog=BDCOFFEE;uid=sa;pwd=")
'ocn.InitializeLifetimeService()
ocn.Open()
' ocn.InitializeLifetimeService()
Catch ex As Exception
End Try
End Sub

LOAD INICIO
Try

If CBOUSUARIO.Text = "" Then


CBOUSUARIO.Focus()
Else
txtclave.Focus()
End If

' PictureBox1.BackgroundImage =
Image.FromFile(("D:\SITSTVCAFE\imagen\IMG-20150802-WA0000ok.JPG"))
Dim i As Integer
Dim ods As DataSet
ods = ciudad.DevuelveUSUARIO
For i = 0 To ods.Tables(0).Select.Length - 1
CBOUSUARIO.Items.Add(ods.Tables(0).Rows(i).Item("CARG"))
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

También podría gustarte