DataSet (xsd) Creating a DataTable

Last post 07-09-2007 3:52 PM by Koldark. 1 replies.

Sort Posts:

  • DataSet (xsd) Creating a DataTable

    07-09-2007, 2:43 PM
    • Loading...
    • Koldark
    • Joined on 10-24-2006, 3:04 PM
    • Mankato, MN
    • Posts 50

    We are trying to grab data from a System i (or iSeries or AS/400) using a DataSet. We have this working and can grab everything from the table. The end result is we want to output a Report (from Visual Studio 2005). The problem is Visual Studio doesn't like my SQL statement:

    select vcmplntnum, vvltnnum, vcakey, vdtcode, vdtcodedsc, 
    vdvcode, vdvcodedsc, veename, vccode, vccodedesc, vcdate, 
    vcaowner, vrcode, 1 as sortorder 
    from qmfiles.nvmastp 
    where (vclosedate = 0) 
    union 
    select vcmplntnum, vvltnnum, vcakey, vdtcode, vdtcodedsc, 
    vdvcode, vdvcodedsc, veename, vccode, vccodedesc, vcdate, 
    vcaowner, vrcode, 2 as sortorder 
    from qmfiles.nvmastp 
    where (vclosedate > 0) and (date(substr(digits(vclosedate), 1, 4) || '-' || substr(digits(vclosedate), 5, 2) || '-' || substr(digits(vclosedate), 7, 2)) >= curdate() - 1 month)

    The problem is if I use either "||" or CONCAT (which are both valid on the System i) the parser in the DataSet tells me it isn't valid. The reason I have to do that is because the date is stored in a decimal field (yyyymmdd).

    Now, from the bit of playing I have done with the reports, you have to use a TableAdapter or DataTable? Like I mentioned before, I have the TableAdapter working, but can't use the above SQL statement. How do I fill a DataTable with the needed information? I am seeing ways to do this with XML in my searches but not from a table. Is there an example out there somewhere that can point me in the general direction?
     

    Mike Wills
    City of Mankato
    Programer/Analyst
  • Re: DataSet (xsd) Creating a DataTable

    07-09-2007, 3:52 PM
    Answer
    • Loading...
    • Koldark
    • Joined on 10-24-2006, 3:04 PM
    • Mankato, MN
    • Posts 50

     Okay, I can still run the statement if I put it in the TableAdapter. Nevermind...

    Mike Wills
    City of Mankato
    Programer/Analyst
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter