jfz139
asked on
How to design C# class and access to SqlServer.
Hi,
I am designing and developing a small new proejct in C# and SqlServer.
Since I am very new to C# and SqlServer (I used to work with Java),
I have the following questions:
1.Is it a good practice to create a class for each table in sqlserver?
2.If not, how to do it in a good way? Any good sample code?
3.Also, any sample code on C# to access SqlServer DB?
Thanks a lot.
Jennifer
I am designing and developing a small new proejct in C# and SqlServer.
Since I am very new to C# and SqlServer (I used to work with Java),
I have the following questions:
1.Is it a good practice to create a class for each table in sqlserver?
2.If not, how to do it in a good way? Any good sample code?
3.Also, any sample code on C# to access SqlServer DB?
Thanks a lot.
Jennifer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
John and Arthur,
Thank you both for helping me. I think both of you answered my question.
And I would like to give both some pts. Since I can accept only one answer,
I am going to accept John's answer. Sorry about it.
Thanks a lot.
Jennifer
Thank you both for helping me. I think both of you answered my question.
And I would like to give both some pts. Since I can accept only one answer,
I am going to accept John's answer. Sorry about it.
Thanks a lot.
Jennifer
There is nbo single, hard-and-fast rule. For a VERY simple application, it would TYPICALLY be the case that you would have one class per table, but this would be a fairly simple structure.
AW