0

I have two textboxes Textbox1 and Textbox2 and 1 gridview

i want my site users may search record either by entering the city name in textbox1 or by entering the country name on textbox2 via gridview .

1 Answer 1

1

There's a whole lot more information we need to help answer this in detail.

In general, you need to take the values in the textboxes, convert them into a SQL query which is sent to the database and bind the resultset which is returned to you gridview.

Depending on what data access mechanism you're using, how to achieve this varies greatly - If you don't know what data access mechanism exist, I'd suggest you start reading up on LINQ-To-SQL as it's pretty easy to use and safe against SQL injection attacks.

If you can provide more details of what you're trying to accomplish, we may be able to help further eg:

  • What version of the .Net Framework are you using
  • What database software i in use (Microsoft SQL Server, MySQL, Oracle, etc.)
  • What does the tabl you want to search look like? (What fields, etc)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.