In the TheeBeerHouse project if I created a stored procedure which comprises of 2 tables.
For example
Create Procedure dbo.[EmpDept]
Select e.Name,e.Salary,d.Location,d.City
From Emp e, Dept d
In the database we created stored procedure of every table like Get, Insert, Delete etc.And against each stored procedure we created funtion in .NET like Get(), Insert(Employee e), Delete(id) etc.
My question is that if a stored procudre has 2 tables should I have to create another class for that procedure? Like for
EmpDept procedure I have to create Detail class, Provider Class, Sqlclient provider class, and BLL class. Is this way is right? If yes it means if I have many procedures which
comprises of different tables then I have to create classes again and again.
Hamza_zarar
Member
78 Points
175 Posts
Create classes against stored procedures
Mar 16, 2009 08:14 AM|LINK
Hi,
In the TheeBeerHouse project if I created a stored procedure which comprises of 2 tables.
For example
Create Procedure dbo.[EmpDept]
Select e.Name,e.Salary,d.Location,d.City
From Emp e, Dept d
In the database we created stored procedure of every table like Get, Insert, Delete etc. And against each stored procedure we created funtion in .NET like Get(), Insert(Employee e), Delete(id) etc.
My question is that if a stored procudre has 2 tables should I have to create another class for that procedure? Like for EmpDept procedure I have to create Detail class, Provider Class, Sqlclient provider class, and BLL class. Is this way is right? If yes it means if I have many procedures which comprises of different tables then I have to create classes again and again.
Suggest me ….
ankit.sri
Contributor
2042 Points
410 Posts
Re: Create classes against stored procedures
Mar 16, 2009 04:48 PM|LINK
You could use LINQ to SQL Classes
http://weblogs.asp.net/scottgu/archive/2006/08/27/Building-and-using-a-LINQ-for-SQL-Class-Library-with-ASP.NET-2.0.aspx