Advertisement
AndreJaya

Untitled

Jan 31st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.50 KB | None | 0 0
  1. Private Sub txtNip_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtNip.KeyPress
  2.         If (e.KeyChar = Chr(13)) Then
  3.            Dim conn as New SqlConnection
  4. Dim stringconn as String = "read stringconn here"
  5. Conn=new sqlconnection(stringconn)
  6. Conn.open()
  7. Dim cmd as new SqlCommand
  8. Dim dr as new sqldatareader
  9. Cmd = new SqlCommand("select * from tbl,conn)
  10. dr= cmd.ExecuteReader()
  11. If dr.Hasrows Then
  12. TxtName.Text= dr.Item ("Name")
  13.        End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement