Results 1 to 6 of 6

Thread: making this query work

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    36

    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????

  2. #2
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    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

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    36
    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

  4. #4
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    it is valid for every provider that exist in .net ODBC, OLEDB, SQL, ORACLE....

    What provider are you using?

    /Henrik

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    36
    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?

  6. #6
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    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
  •  



Click Here to Expand Forum to Full Width