I am getting an error in the following code.
The error message is "The ConnectionStrin g property has not been initialized."
How can I resolve this?
The error message is "The ConnectionStrin g property has not been initialized."
How can I resolve this?
Code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim strsql7 As String
Dim cm7 As New SqlCommand
Dim dt7 As New DataTable
Dim da7 As New SqlDataAdapter
conn.openDatabase()
strsql7 = "SELECT username, password, name , money FROM member where username='" & TextBox7.Text & "' "
strsql7 = strsql7 & " union "
strsql7 = strsql7 & "SELECT username, password, name_admin , money FROM admin where username='" & TextBox7.Text & "' "
cm7.Connection = conn.sqlConnDB
cm7.CommandText = strsql7
da7.SelectCommand = cm7
da7.Fill(dt7)
Comment