473,500 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Q: DataAdapters and Global WildCard Searches

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
Dec 17 '05 #1
2 1653
JohnT,

First of all, SQL for Access is much limited than for most other
databaseServers.

http://msdn.microsoft.com/library/de.../acfundsql.asp

See as well the links to the additional resources at the bottom of this
article

Although I am strugling with this one as well forever.

I my opinion do you do it very it correct and than my idea is, why not just
replace the selectString (or SP) in your commandText for one without the
WHERE clause?

That you fill than the parameters does not harm at all.

I hope this helps,

Cor

"JohnT" <Jt@MyHome.com> schreef in bericht
news:h0********************************@4ax.com...
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

Dec 17 '05 #2
>First of all, SQL for Access is much limited than for most other
databaseServers.
Understood.
I my opinion do you do it very it correct and than my idea is, why not just
replace the selectString (or SP) in your commandText for one without the
WHERE clause?

That you fill than the parameters does not harm at all.

I hope this helps,


Thank you Sir... I'll play with it some and see where I get!

JohnT
Dec 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7375
by: Robert Brown | last post by:
I have researched newsgroups and the web very thoroughly and unsuccessfully for a solution to what I believe is a very common problem. I know it's easy to do wildcard match against data in DB...
1
7228
by: deko | last post by:
I have a form where users can enter a string with asterisks to perform a wildcard search. Currently, the string entered by the user looks like this: *somestring* The purpose is to match any...
3
1376
by: JJ | last post by:
Hi All I have a DataAdapter that I create in a middle data tier. Now if I called that middle data tier class and it creates that DataAdapter that is global in that class does it persist through...
2
1282
by: Vik | last post by:
Is it possible to loop through all dataadapters on page? Thanks
2
1974
by: MB | last post by:
Hi, I am using a datagrid and the datagrid is filled through the SQL query. The SQL query searches for the match in the database. The SQL Query that i am writing is as follows Dim selprod As...
3
2241
by: george.lengel | last post by:
Hello experts, I have been struggling for days to solve this problem and every suggestion I find via Google does not work for me. There is probably a solution out there that will do what I want,...
4
1576
by: madeleine.macphail | last post by:
I'm currently tearing my hair out on this one. I'm trying to run through a bunch of worksheets in a bunch of workbooks and only run an import on the ones that match the type of name I'm looking...
21
3420
Dököll
by: Dököll | last post by:
Greetings Again, All! I know a bit more of the back end of things than front. Every now and then I use wildcard to retrieve data via sql advantage, oracle, and of course, our beloved MS Access...
0
2655
by: savage678 | last post by:
Hi Everyone, I am new to this forum and am i dire need of some help. I am trying to use wildcard searches in infopath. I have it connected to an access database using data connection. I have...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.