Hi, i have a problem trying to query my database based on a value in a label.

Here is the code for the query,
Dim myCommand As New SqlCeCommand("Select * from CDRecord where ArtisteName like '%(label4.text)%'", conn)

It shows no errors but during runtime, i get a blank for the results.

Please help me.
Thanks :)

write your query like this

Dim myCommand As New SqlCeCommand("Select * from CDRecord where ArtisteName like '%" & (label4.text) & "%'", conn)

try this query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.