M
morleyc
Hi, i have seen some example code which uses a stored parameter that
performs two selects and returns a SafeDataReader, a customer is
retrieved along with all of their orders. The stored procedure is
below:
SELECT CustomerID, CompanyName, ContactName, Country
FROM Customers
WHERE (CustomerID = @CompanyID)
SELECT OrderID, ShippedDate, Freight
FROM Orders
WHERE (CustomerID = @CompanyID)
What i need is a multi-table query but i want to use the typed
datasets in Visual Studio 2005. However, I cant seem to add that in
the dataset designer, i can only create queries for selecting single
values and not selecting rows as i need (that option is greyed out).
So currently i am doing the following, in code:
CustomersTableAdapter sessions = new CustomersTableAdapter ();
int customerID = sessions.GetDataByCustomerID( search_criteria_here )
[0].CustomerID;
OrdersTableAdapter details = new OrdersTableAdapter ();
OrdersDataTable orders = details.GetDataBySessionID(customerID);
Should i move to technology which supports stored procedures or can i
have my cake and eat it and have the same functionality but with the
typed DataSets? Is the stored procedure more efficient for selecting
parent and related child records?
Thanks in advance,
Chris
performs two selects and returns a SafeDataReader, a customer is
retrieved along with all of their orders. The stored procedure is
below:
SELECT CustomerID, CompanyName, ContactName, Country
FROM Customers
WHERE (CustomerID = @CompanyID)
SELECT OrderID, ShippedDate, Freight
FROM Orders
WHERE (CustomerID = @CompanyID)
What i need is a multi-table query but i want to use the typed
datasets in Visual Studio 2005. However, I cant seem to add that in
the dataset designer, i can only create queries for selecting single
values and not selecting rows as i need (that option is greyed out).
So currently i am doing the following, in code:
CustomersTableAdapter sessions = new CustomersTableAdapter ();
int customerID = sessions.GetDataByCustomerID( search_criteria_here )
[0].CustomerID;
OrdersTableAdapter details = new OrdersTableAdapter ();
OrdersDataTable orders = details.GetDataBySessionID(customerID);
Should i move to technology which supports stored procedures or can i
have my cake and eat it and have the same functionality but with the
typed DataSets? Is the stored procedure more efficient for selecting
parent and related child records?
Thanks in advance,
Chris