-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.vb
32 lines (24 loc) · 895 Bytes
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Imports System.Data.SqlClient
Public Class Form1
Private cnx As SqlConnection
Private cmd As SqlCommand
Private reader As SqlDataReader
Private results As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
cnx = New SqlConnection("Initial Catalog=db_planification;" &
"Data Source=fath-device;Integrated Security=SSPI;")
cmd = cnx.CreateCommand
cmd.CommandText = "SELECT * FROM test"
cnx.Open()
reader = cmd.ExecuteReader()
reader = cmd.ExecuteReader()
Do While reader.Read()
results = results & reader.GetString(0) & vbTab &
reader.GetString(1) & vbLf
Loop
'Display results.
MsgBox(results)
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
End Class