Codigo Conexion Base Datos
Enviado por leomaryed • 19 de Julio de 2014 • 2.582 Palabras (11 Páginas) • 432 Visitas
Modulo conexión
Imports System.Data.SqlClient
Module Conexion
Public Class Conexion1
Public cnn As New SqlConnection
Public Function Conectado()
Try
cnn = New SqlConnection("Data Source=A-3\SQLEXPRESS;Initial Catalog=Tienda;Integrated Security=true")
cnn.Open()
Return True
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
End Function
Public Function desconectado()
Try
If cnn.State = ConnectionState.Connecting = True Then
cnn.Close()
Return True
Else
Return False
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
Return False
End Try
End Function
End Class
End Module
--Modulo de datos
Module datos
Public Class datos1
Dim clav As String
Dim prod As String
Dim prov As String
Dim clasif As String
Dim cant As String
Dim prec As String
Dim exis As String
Public Property gclav()
Get
Return clav
End Get
Set(ByVal value)
clav = value
End Set
End Property
Public Property gprod()
Get
Return prod
End Get
Set(ByVal value)
prod = value
End Set
End Property
Public Property gclasif()
Get
Return clasif
End Get
Set(ByVal value)
clasif = value
End Set
End Property
Public Property gprov()
Get
Return prov
End Get
Set(ByVal value)
prov = value
End Set
End Property
Public Property gcant()
Get
Return cant
End Get
Set(ByVal value)
cant = value
End Set
End Property
Public Property gprec()
Get
Return prec
End Get
Set(ByVal value)
prec = value
End Set
End Property
Public Property gexis()
Get
Return exis
End Get
Set(ByVal value)
exis = value
End Set
End Property
Public Sub New(ByVal clav As String, ByVal prod As String, ByVal prov As String, ByVal clasif As String, ByVal cant As String, ByVal prec As String, ByVal exis As String)
gclav = clav
gprov = prov
gprod = prod
gclasif = clasif
gcant = cant
gprec = prec
gexis = exis
End Sub
Public Sub New()
End Sub
...