Saturday, October 14, 2006

Para memorizar...

Objetos

Private cad As String

Private cnn As New MySqlConnection

Private da As MySqlDataAdapter

Private ds As DataSet

Private query As String

----

Consultas sql

cad = "Database=prueba;Data Source=localhost;User Id=root;Password=system"

cnn = New MySqlConnection(cad)

query = "select * from usuario"

da = New MySqlDataAdapter(query, cnn)

ds = New DataSet

da.Fill(ds, "general")

'En la tabla Virtual General esta la consulta


Dim i As Integer

Dim n As Integer

n = ds.Tables("general").Rows().Count

i = 0

While (i <>

If (ds.Tables("general").Rows(i).Item(0) = TextBox1.Text) And (ds.Tables("general").Rows(i).Item(1) = TextBox2.Text) Then

Label3.Text = "Ok"

Else

MsgBox("error")

End If

i = i + 1

End While


----

Insersion