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 :)

Recommended Answers

All 2 Replies

write your query like this

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

try this query.

which language you r using C# or VB.net

Be a part of the DaniWeb community

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