Solved

VB.Net Access Search

Posted on 2004-04-16
10
263 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now