Solved

VB.Net Access Search

Posted on 2004-04-16
10
265 Views
Last Modified: 2010-04-24
I need some help getting started.  I created a connection to a Access DataBase, I was able to import the Data onto a DataGrid Easily.  Now I have to make a search that will search for names, ID's and such... One problem i have is that the Table Field names are   "Customer ID" or "Contact Name" which have spaces in them.  How do I handle those?

My options that I see are either the DataView or use a OleDBCommand what are the syntax for using those? so i can filter out the ones I do not need.  I also want to be able to use WildCards to search partial properties.

I'm not looking for a full solution really just some help to get started or Links to websites where i can read up on it
0
Comment
Question by:linkkoh
  • 5
  • 4
10 Comments
 
LVL 2

Expert Comment

by:nibirkhan
ID: 10847177
SQL Statement should be

Suppose you are searching by "Customer ID"
-------------------------------------------------
Select [Customer ID], [Contact Name]
FROM TableName
WHERE ( [Customer ID] = ? )

"?" will work as the parameter from the forms field.

0
 
LVL 2

Author Comment

by:linkkoh
ID: 10847363
That code will probilby work for SQL and ASP Pages.  But I am looking for a Strictly VB.NET Application.  I did try it that way, but it didn't do anything.
0
 
LVL 2

Author Comment

by:linkkoh
ID: 10848032
I found my answer by myself, Please cancel this threat
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 2

Expert Comment

by:nibirkhan
ID: 10854815
ask the community support to do that...meanwhile could you please share it with us how did you do it??

thanks
0
 
LVL 2

Author Comment

by:linkkoh
ID: 10855929
Me.CustomerData.Clear()

Me.OleDbDataAdapter1.SelectCommand.CommandText = "SELECT [Customer ID], [Customer Name], [Contact Title], [Contact First Name], [Contact Last Name], [Contact Position], [E-mail], Phone FROM [Customer] where [Customer Name] Like '%" & TextBox1.Text & "%'"

Me.OleDbDataAdapter1.Fill(CustomerData)

Me.DataGrid1.Refresh()

CustomerData being the DataSet
0
 
LVL 2

Expert Comment

by:nibirkhan
ID: 10863688
cool...community support can clean this thread up..I have no complain....or urged for  credits..

nibirkhan
0
 
LVL 2

Author Comment

by:linkkoh
ID: 10864075
How do i contact community support?
0
 
LVL 2

Expert Comment

by:nibirkhan
ID: 10864179
http://www.experts-exchange.com/Community_Support/

( I have answered your question..so, now you need to give me points..kidding..)
0
 
LVL 2

Author Comment

by:linkkoh
ID: 10864460
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10872059
PAQd, 50 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question