TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Baka Musky
NA
10
614
Query for a combobox and textbox to search within a datagrid
Jul 14 2017 7:03 AM
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.
Reply
Answers (
6
)
Not able to Update stored proceduere
How to get total cost of start package table between two per