Hello guys,
Can anyone tell me why do I get the error message in the code below?
The code fires onPageLoad.
What should I change?
Dim con As New SqlConnection
con.ConnectionString = "Data Source=s01.winhost.com;Initial Catalog=DB_10078_kdn;Persist Security Info=True;User ID=xxxxx;Password=******"
Dim s As String
s = "SELECT * FROM Users WHERE Seller_id LIKE '" & Label5.Text & "'"
Dim ds As New DataSet
Dim da As New SqlDataAdapter(s, con)
Try
da.Fill(ds)
Catch ex As Exception
End Try
DropDownList1.DataSource = ds
DropDownList1.DataBind()
DropDownList1.DataValueField = "Seller_id"
DropDownList1.DataTextField = "Account_Type"
Label7.Text = DropDownList1.SelectedItem.Text
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.