|
-
Jan 22nd, 2004, 05:58 AM
#1
Thread Starter
Member
making this query work
hi, i have made a query using the dataset function that is:
SELECT Availibilty.*
FROM Availibilty
this is just pulling everything out but i want to make it extract data that a user enters via a textbox. i have a text box called txtWeek.
basicall i want somehting like this:
SELECT Availibilty.*
FROM Availibilty
WHERE Availibilty.Week = txtWeek.Text
is this possible to sue or would i have to use this as a command in my code????
-
Jan 22nd, 2004, 07:46 AM
#2
Frenzied Member
I suggest you create a command object, build your sql query, and then fill your dataset with the dataadapter fill method... manually...
1) make connection
2)make command
3)make datadapter that uses conn and command)
4)fill a dataset with dataadapter
use the dataset...
may I suggest that you build the sql query with the stringbuilder object, it conserves memory and is good practice...
kind regards
henrik
-
Jan 22nd, 2004, 07:53 AM
#3
Thread Starter
Member
thanks, for the reply. i did think this but i have the wrox book beginning vb.net v2. they only talk about using this method with mysql. I take it that this way is also valid as i am using ms access???
thanks again
-
Jan 22nd, 2004, 07:55 AM
#4
Frenzied Member
it is valid for every provider that exist in .net ODBC, OLEDB, SQL, ORACLE....
What provider are you using?
/Henrik
-
Jan 22nd, 2004, 07:56 AM
#5
Thread Starter
Member
i take it u mean my database when u sy provider? i am using the Microsoft jet 4.0 to connect to an access 2003 db?
-
Jan 22nd, 2004, 08:52 AM
#6
Frenzied Member
You're using OLEDB in that case.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|