Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# 2.0 Return DataReader object
Message
From
09/03/2012 15:08:51
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01537785
Message ID:
01537828
Views:
28
>I don't really have a framework. Let me describe what my code does.
>
>User enters some values (in a couple of textbox controls) of an .aspx page.
>The C# code behind the page calls a method of a BIZ Class (I call it business class but I am not sure if it is technically so).
>Anyway, the method of the BIZ class creates connection and get a data reader object based on the parameters passed (user entry).
>The Data Reader is then returned from the BIZ class method to the page code behind and the values of the Data Reader are used in the Code Behind.
>
>So my challenge was/is that the BIZ class method should return a data reader but either OleDb type or SQL Server type (depending on the back end).
>
>Hopefully my explanation makes sense.

The C# example you obtained in the other message is a replica of my data class, but at a high level only. That would be the way to follow. It is just that I have thousands of lines in mine which handles pretty much anything you could imagine in regards to a data class. It took me a while to build it. But, it was worth it at the end.

As for the Hungarian reference, it is just a naming convention. The goal is to have one. I really do not care which one people uses as long as they have one I think this is good. This is what I teach. I wouldn't touch any code if there wouldn't be any convention in it. It would be a total waste of time. In such a case, people involved might as well start from scratch. Mine is dated from the earlier '90s from a class I took from Yair Alan Griver. This is kind of a reverse hungarian notification. I apply it to everything. It was first used in VFP, then in .NET and javascript. At least, when I see loConnection, I know it is a local variable of type object about the Connection namespace. As simple as it gets, cFirsName would then be a public property of type string for the first name. I have seen so many examples on the net with For i =.... Wow, when I see it down below the code, I say to myself what the heck is i for. But, if I see For lnCounter=... Then, down below the code, if I see a reference to it, I know it is a local variable of type integer for a counter. In VFP, most of the developers had a good naming convention. When I started to move to .NET, I saw that most of that disappeared in space and it was sad.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform