Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2004, 09:46 AM
Authorized User
 
Join Date: Mar 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mistry_bhavin
Default How to generate SQL querries

Hello to all

I am working with vb.net.
I am having table contains all information of customer
like first name, last name, address, contatc numbers etc.(35 fields)

I want to search record from database acording to
any field as user of my application needs.

I generate querries by using if..else.. but it is
vary difficult and can not be used for more than one
table.

Is there any control awailable (vb controls or third party controls)that can generate querries for
me or any program logic that servers me ?

Thank you.




 
Old August 12th, 2004, 11:42 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Once you have your data in a dataset, you could iterate thru each column and generate a search string for the datatable's default view "filter" property. You can get the datafield from the column and construct a filter string similar to SQL:

fieldname like '%search value%'

Do this for each column, and string them together with commas, then assign to the datatable's defaultview.filter property. Then the default view will have your filtered data. You can do it all on the .net object side instead of the database side.





Similar Threads
Thread Thread Starter Forum Replies Last Post
sql query to generate counts by month lethe SQL Server 2000 10 December 23rd, 2017 05:33 AM
how generate ThePhileII-Load.sql once chinahyf BOOK: ASP.NET Website Programming Problem-Design-Solution 2 December 25th, 2005 09:18 PM
Generate SQL Script shaileshk SQL Server 2000 3 September 6th, 2005 03:12 PM
how to generate sql insert using generateInserts() method Access VBA 4 March 12th, 2005 12:17 PM
How to generate SQL querry ? mistry_bhavin ADO.NET 1 August 12th, 2004 01:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.