J
JohnT
Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file.
I have two DataAdapters that I use to search for specific info. The two of
them are similar except one is a Date, the other is a String.
Currently they both work as I like and I can get my data as I want. What I'm
intersted in is seeing HOW I do a Global search for both cases. Here are my
two issues:
ISSUE 1:
Dates... in my SELECT I search for a date using something like:
.... WHERE MyDate = ?
.... then...
daMyData.SelectCommand.Parameters(0).Value = WeekEndDate
daMyData.Fill(DsMyData.MyDataTable)
If I want to get ALL of my data regardless of the Date, I've figured out that
I can add in a 2nd Parameter (ie: most earliest date to most latest date).
Thus I get the data between the two dates.
.... WHERE MyDate BETWEEN ? and ?
.... then...
daMyData.SelectCommand.Parameters(0).Value = StartDate
daMyData.SelectCommand.Parameters(1).Value = EndDate
daMyData.Fill(DsMyData.MyDataTable)
My question is: IS this the correct way (using 2 parameters)? Or is there
some kind of Global search (ie: * ) for a Date using my original single
Parameter?
ISSUE 2:
Strings: Similar to the above, I do a search for a string:
.... WHERE MyData = ?
.... then...
daMyData.SelectCommand.Parameters(0).Value = FindData
daMyData.Fill(DsMyData.MyDataTable)
So my question is: HOW do I do a global wildcard search (ie: * ) for a String?
If this is at alll possible.
Basically the two issues are for when I want to see ALL of my data rather than
specific search criteria.
Is it just that I have to create a new DataAdapter/Set where I don't do any
WHERE statement?
Appreciate any input.
JohnT
I have two DataAdapters that I use to search for specific info. The two of
them are similar except one is a Date, the other is a String.
Currently they both work as I like and I can get my data as I want. What I'm
intersted in is seeing HOW I do a Global search for both cases. Here are my
two issues:
ISSUE 1:
Dates... in my SELECT I search for a date using something like:
.... WHERE MyDate = ?
.... then...
daMyData.SelectCommand.Parameters(0).Value = WeekEndDate
daMyData.Fill(DsMyData.MyDataTable)
If I want to get ALL of my data regardless of the Date, I've figured out that
I can add in a 2nd Parameter (ie: most earliest date to most latest date).
Thus I get the data between the two dates.
.... WHERE MyDate BETWEEN ? and ?
.... then...
daMyData.SelectCommand.Parameters(0).Value = StartDate
daMyData.SelectCommand.Parameters(1).Value = EndDate
daMyData.Fill(DsMyData.MyDataTable)
My question is: IS this the correct way (using 2 parameters)? Or is there
some kind of Global search (ie: * ) for a Date using my original single
Parameter?
ISSUE 2:
Strings: Similar to the above, I do a search for a string:
.... WHERE MyData = ?
.... then...
daMyData.SelectCommand.Parameters(0).Value = FindData
daMyData.Fill(DsMyData.MyDataTable)
So my question is: HOW do I do a global wildcard search (ie: * ) for a String?
If this is at alll possible.
Basically the two issues are for when I want to see ALL of my data rather than
specific search criteria.
Is it just that I have to create a new DataAdapter/Set where I don't do any
WHERE statement?
Appreciate any input.
JohnT