Stored Procedure And Classes

Greetings:

I am quite new in object oriented programing. Well I know how to build a Data class that will only interface between my objects and my database.

Say for example I have a class User that contains User.UserISValid or User User User.UserIsAdministrator, now I want another class called Dataclass that will only deal with my data manipulation, so what I want to do is to use a  stored procedure that accepts userID as parameter Input in SQL Server and returns me UserISValid= True/False and UserIsAdministrator=True Or False.

Can someone help me

Thanks

 

 

 



Answer this question

Stored Procedure And Classes

  • ytandeta

    You have several options, here are some suggestions:

    You can create a procedure that returns a User class/struct. You initialize your user class with values you get from the SQL-query.

    You can return a DataRow. Downpoint on this one that the names of your SQL-columns will be used in the layers above the datalayer.

    You can return a hashtable



  • Stored Procedure And Classes