Results 1 to 2 of 2

Thread: Querry help

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Location
    dallas,texasd
    Posts
    26

    Querry help

    I have created a small querry and for some reason my container (datalist) is not reconizing the company name


    This is also the first time that i have created a querry with two select statements in the sproc....

    Does it make a difference if there is two select statements in a querry?? When populating a datalist?

    Not sure if i need to seperate the two statements some kind of way..


    Is this ok to use with datalist?

    Erik..


    ALTER PROCEDURE Get_Information_For_Datalist_Global_

    @IDProduct AS INT,
    @IDCompany AS INT

    AS


    SELECT Product.ProductName,
    Product.ProductID,Product.ProductImage,
    Product.ProductDescription, SprocsTable.*


    FROM Product
    INNER JOIN
    SprocsTable ON Product.ProductID = SprocsTable.ProductID

    WHERE Product.ProductID = @IDProduct


    SELECT Company.CompanyID, Company.CompanyName

    FROM COMPANY
    WHERE COMPANY.COMPANYID = @IDCompany

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Querry help

    I've never used a DataList, but I would think that it will just display whatever you put into it. Presumably you are using a DataAdapter and a DataSet to retrieve this data, or perhaps a DataReader. If you are using a DataSet then you should have one DataTable for each query. If you are using a DataReader, you need to call NextResult to progress to the next result set. If you have bound your DataList directly to a DataReader, it may not be possible to make this call and have the DataList see the subsequent result sets, or perhaps you just make the call after setting the DataSource.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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