Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/07/2009, 12:17
soldierjesus
 
Fecha de Ingreso: agosto-2008
Ubicación: Cali . Colombia
Mensajes: 459
Antigüedad: 16 años, 6 meses
Puntos: 1
Respuesta: comparar datos de usuario

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim csb As New SqlConnectionStringBuilder
With csb

.DataSource = "(local)\SQLEXPRESS"

.InitialCatalog = "prueba"

.IntegratedSecurity = True
End With

Using con As New SqlConnection(csb.ConnectionString)
Dim tran As SqlTransaction = con.BeginTransaction
Dim sInsert As String = _
"SELECT FROM admin WHERE login=textbox1.text " & _
"(login, pass) " & ""


Dim cmd As New SqlCommand(sInsert, con)

With cmd
.Parameters.AddWithValue("", txtNombre.Text)
.Parameters.AddWithValue("@Correo", txtCorreo.Text)

End With
cmd.Transaction = tran
Try
' Ejecutamos el comando
cmd.ExecuteNonQuery()

' Si llega aquí es que todo fue bien,
' por tanto, llamamos al método Commit
tran.Commit()

Catch ex As Exception

tran.Rollback()

End Try

con.Close()
End Using
__________________
Jaime P. Bravo
Programador Web
MCP (Microsoft Certified Professional)