How to make search bar in asp.net which fetch record from database according to user input in asp.net?
I want to make search field where user enter his required data, and if data is available is DB then it fetch that data and display it. if not then give error message. using asp.net. Any Idea? or visual studio 2010 have any component like that? I am new to asp.net.
ASP.net Data access tutorials would be a good place to start
The question is so general to answer, but you can make a query using the required criteria you want to filter or search according to it.
if you want to search about specific record in your table you can use COUNT()
function in SQL
to get the number of records, if it returns 0
then no data returned and you can show info message, if it returned > 0
then fetch the data back.
精彩评论