Solved

VB.Net Access Search

Posted on 2004-04-16
10
258 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

18 Experts available now in Live!

Get 1:1 Help Now