![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I would appreciate any comments on the following code--particularly criticism that is constructive. It is some of my first data-layer code. I felt these helper routines would be helpful in their own data-layer class. There are a few issues that came up, mostly related to using an SqlDataReader. Also, the compiler complains that all my trailing, default return statements are unreachable, which doesn't seem right. But these routines appears to work okay. |
#3
| |||
| |||
|
|
Hi Jonathan, I preffer doing a strong typed approach - i.e. use a code generator (think CodeSmith, or LINQ Designer if you work with VS2008) that generates strong typed methods for me. -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:uIldXNdRIHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl... I would appreciate any comments on the following code--particularly criticism that is constructive. It is some of my first data-layer code. I felt these helper routines would be helpful in their own data-layer class. There are a few issues that came up, mostly related to using an SqlDataReader. Also, the compiler complains that all my trailing, default return statements are unreachable, which doesn't seem right. But these routines appears to work okay. |
#4
| |||
| |||
|
|
I'm using VS2008, so I could try LINQ. However, my understanding is that you get better database performance with stored procedures. But, if you'd care to provide some reasons for your preferences, that's something I would be interested in. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "Miha Markic" <miha at rthand com> wrote in message news:Ol3yKAhRIHA.5288 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Hi Jonathan, I preffer doing a strong typed approach - i.e. use a code generator (think CodeSmith, or LINQ Designer if you work with VS2008) that generates strong typed methods for me. -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:uIldXNdRIHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl... I would appreciate any comments on the following code--particularly criticism that is constructive. It is some of my first data-layer code. I felt these helper routines would be helpful in their own data-layer class. There are a few issues that came up, mostly related to using an SqlDataReader. Also, the compiler complains that all my trailing, default return statements are unreachable, which doesn't seem right. But these routines appears to work okay. |
#5
| |||
| |||
|
|
Hi Jonathan, I was talking about capability of LINQ to SQL designer to create wrapper methods for stored procedure (you just drag & drop a stored procedure from server explorer onto designer surface) invocation IOW it creates a C#/VB method with all the parameters that sp expects. This method in turn calls stored procedure with given parameters. -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:ONwRD9kRIHA.6060 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I'm using VS2008, so I could try LINQ. However, my understanding is that you get better database performance with stored procedures. But, if you'd care to provide some reasons for your preferences, that's something I would be interested in. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "Miha Markic" <miha at rthand com> wrote in message news:Ol3yKAhRIHA.5288 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Hi Jonathan, I preffer doing a strong typed approach - i.e. use a code generator (think CodeSmith, or LINQ Designer if you work with VS2008) that generates strong typed methods for me. -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:uIldXNdRIHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl... I would appreciate any comments on the following code--particularly criticism that is constructive. It is some of my first data-layer code. I felt these helper routines would be helpful in their own data-layer class. There are a few issues that came up, mostly related to using an SqlDataReader. Also, the compiler complains that all my trailing, default return statements are unreachable, which doesn't seem right. But these routines appears to work okay. |
#6
| |||
| |||
|
|
Sounds cool, but then I guess I'd need to create one for each stored procedure. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |