How do I query a dataset and return a new table

Discussion in 'ASP .Net' started by HB, Oct 28, 2005.

  1. HB

    HB Guest

    I have an application that is requiring me to pull 4 tables into a dataset
    then perfom the final query to display on the page


    Dim objODBCAdapter As New Data.Odbc.OdbcDataAdapter("SELECT
    WBS_CMF_NO, WBS_KEY, WBS_DESCRIP FROM CT07WBS;", conn)
    objODBCAdapter.Fill(DS, "wbstemp")

    How do I excecute the query below against the wbstemp table I just created?

    objODBCAdapter.SelectCommand.CommandText = "SELECT
    Left([wbs_cmf_no],4) AS Acct, Right([wbs_cmf_no],3) AS Sub, WBS_CMF_NO,
    WBS_KEY, WBS_DESCRIP FROM CT07WBS;"
    objODBCAdapter.Fill(DS, "wbs")

    Due to limitations I cannot use left and right in the original (first)
    statement


    Thanks for the help
    HB, Oct 28, 2005
    #1
    1. Advertising

  2. have a look if RowFilter can help you at least filter out from each of the
    4 tables

    http://msdn.microsoft.com/library/d...rlrfSystemDataDataViewClassRowFilterTopic.asp

    --
    Regards

    John Timney
    ASP.NET MVP
    Microsoft Regional Director

    "HB" <> wrote in message
    news:OvJyUT$...
    >I have an application that is requiring me to pull 4 tables into a dataset
    >then perfom the final query to display on the page
    >
    >
    > Dim objODBCAdapter As New Data.Odbc.OdbcDataAdapter("SELECT
    > WBS_CMF_NO, WBS_KEY, WBS_DESCRIP FROM CT07WBS;", conn)
    > objODBCAdapter.Fill(DS, "wbstemp")
    >
    > How do I excecute the query below against the wbstemp table I just
    > created?
    >
    > objODBCAdapter.SelectCommand.CommandText = "SELECT
    > Left([wbs_cmf_no],4) AS Acct, Right([wbs_cmf_no],3) AS Sub, WBS_CMF_NO,
    > WBS_KEY, WBS_DESCRIP FROM CT07WBS;"
    > objODBCAdapter.Fill(DS, "wbs")
    >
    > Due to limitations I cannot use left and right in the original (first)
    > statement
    >
    >
    > Thanks for the help
    >
    John Timney \( MVP \), Oct 28, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    1,792
    Chris Taylor
    Oct 31, 2003
  2. Nedu N
    Replies:
    2
    Views:
    2,151
  3. X X
    Replies:
    4
    Views:
    350
    red floyd
    Jul 19, 2010
  4. Nedu N
    Replies:
    2
    Views:
    219
    Jacob Yang [MSFT]
    Oct 31, 2003
  5. Jason Shohet
    Replies:
    1
    Views:
    153
    jason
    Sep 30, 2003
Loading...

Share This Page