.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

SQLServer driven search in asp.net application

Posted By: Ramesh     Posted Date: March 31, 2010    Points:2   Category :ASP.Net
Hi,

I need to search user input value from one table of database in sql server. In a table i need to search from 3 column. How to do that?

I am using asp.net and C# as my code language

Regards
Ramesh

Responses
Author: Dilip          Accepted Answer   
Posted Date: March 31, 2010     Points: 10   

Hi Ramesh,

Try out this

Let Say you have table call TAB and columns COL1,COL2,COL3


Select * from TAB where COL1='Search String'
<UNION ALL/UNION>
Select * from TAB where COL2='Search String'
<UNION ALL/UNION>
Select * from TAB where COL3='Search String'

Regards
Dilip


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend