Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
6
Answers
Query for a combobox and textbox to search within a datagrid
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Baka Musky
7y
177
1
Reply
Hey everyone,
I currently nearly finished a simple application, but my query doesnt work. I have a combobox and a textbox. By selecting a column name from the combobox, I want to be able to search in the textbox within that column. Anyone that can fix this query? I've been trying alot but havent had any succes yet.
SqlCommand command = new SqlCommand("SELECT * FROM dbo.Kwartaal " +
"WHERE '" + searchField + "' LIKE '% " + txtSearch.Text + "%' ", con);
Edit: searchField is my string that gets filled by selecting the column. txtSearch is the textbox obviously.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
Not able to Update stored proceduere
How to get total cost of start package table between two per