I have a sproc that retrieves department information based on the department chosen and then, through a separate Select statement, retrieves all drawings for that department. It's a really simple sproc, similar to that used for authentication and authorization:
SELECT * FROM Departments
WHERE DeptName = @Name
SELECT * FROM Drawings dr, Departments de
WHERE (dr.DeptID = de.ID) AND (de.DeptName = @Name)
The sproc runs great in SQL Server Management Studio...returns the Department data and all three rows of test Drawing data having a DeptID equal to the Department ID. If I try executing it from Server Explorer in the VS IDE, it returns nothing for either Select statement. If I execute it from inside my application, it populates the Department object with the appropriate data, but it only populates one Drawing object in my Drawings collection; in other words, the SafeDataReader passed to the child Fetch method says there's only one row returned from the second Select statement.
What gives?
Much as I hated having to do it, I went back and made a few changes to the data tables and regenerated my Department, Drawings and Drawing objects...sooooo, I'm able to retrieve all the child rows.
My problem now is creating a new Drawing object; to test the Fetch methods, I fat-fingered data into the Drawings table. The Department object gets created and populated, but I can't for the life of me figure out how to add a Drawing object. I thought maybe something like
Dept.Drawing dwg = Library.Drawing.NewDrawing();
but that doesn't work since the NewDrawing method isn't exposed. So, I tried Dept.Drawing.NewDrawing(); to the right of the equal sign...again, no such luck. I didn't seem to have this much difficulty using 1.5x of CSLA, so why am I having it now? *sigh*
Allen
Copyright (c) Marimer LLC