954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

splitting a filter string in 2 textboxes

Hi, im trying to do a filter, now what I want to do is to separate the Game Title into another textbox, any help appreciated
my code -

string tmp = textBox.Text;
string filterString = "[Platform]" + " LIKE '" + tmp + "*'" + "OR [Game Title]" + " LIKE '" + tmp + "*'";
this.tblGameBindingSource.Filter = filterString;

thanks

ppatryk
Newbie Poster
7 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

You have to explain a little bit more, like what is your input and what shall be your output? What kind of type is your tblGameBindingSource ? A SQL-Datasource?

maybe like this?

string tmp = textBox.Text;
      string filterString = string.Format("[Platform] LIKE '%{0}%' OR [Game Title] LIKE '%{0}%'",tmp);
      this.tblGameBindingSource.Filter = filterString;


But if you code like this you have to take care of sql injections .

Wegginho
Newbie Poster
20 posts since Feb 2011
Reputation Points: 12
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: