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