Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Imports System.Data.Odbc
  2. Public Class Form1
  3.  
  4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. Dim conn As OdbcConnection
  6. Dim comm As OdbcCommand
  7. Dim dr As OdbcDataReader
  8. Dim connectionString As String
  9. Dim sql As String
  10. connectionString = "DSN=14itr048;UID=14itr048;Pwd=14itr;"
  11. sql = "SELECT balance from bank where name=' " & TextBox1.Text & " ' and password=' " & TextBox2.Text & " ';"
  12. conn = New OdbcConnection(connectionString)
  13. conn.Open()
  14. comm = New OdbcCommand(sql, conn)
  15. dr = comm.ExecuteReader()
  16. While (dr.Read())
  17. TextBox3.Text = (dr.GetValue(0).ToString())
  18. ' TextBox3.Text = (dr.GetValue(1).ToString())
  19. 'TextBox3.Text = (dr.GetValue(2).ToString())
  20. End While
  21. conn.Close()
  22. dr.Close()
  23. comm.Dispose()
  24. conn.Dispose()
  25. End Sub
  26. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement