• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

VB.Net Access Search

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
linkkoh
Asked:
linkkoh
  • 5
  • 4
1 Solution
 
nibirkhanCommented:
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
 
linkkohAuthor Commented:
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
 
linkkohAuthor Commented:
I found my answer by myself, Please cancel this threat
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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

thanks
0
 
linkkohAuthor Commented:
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
 
nibirkhanCommented:
cool...community support can clean this thread up..I have no complain....or urged for  credits..

nibirkhan
0
 
linkkohAuthor Commented:
How do i contact community support?
0
 
nibirkhanCommented:
http://www.experts-exchange.com/Community_Support/

( I have answered your question..so, now you need to give me points..kidding..)
0
 
linkkohAuthor Commented:
0
 
GhostModCommented:
PAQd, 50 points refunded.

GhostMod
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now