Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View into Dataset
Message
De
09/11/2009 08:30:08
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01433587
Message ID:
01433806
Vues:
36
>Awesome, everyone, thanks for your tips.
>
>I created a simple subclass of an mmBusinessObject, called it Queries (in restrospect maybe not the best name but I'll deal with that later). Erased Queries.partial.cs since I'm not concerned the generator will overwrite anything later.
>
>In Queries.cs now, I simply create ad hoc methods for whatever I want. eg.
>
> public DataSet getMembershipSummary()
> {
> this.TableName = "crsMembershipSummary";
> return this.GetDataSet("SELECT * FROM [qryProfile - Membership Summary]", CommandType.Text);
> }
>
>(Turns out the 2nd parameter on GetDataSet is kinda important, otherwise it looks for a stored procedure with the name of the 1st parameter). All my connection info is derived from the main business object so I don't have to worry about any of that, which is what I was really hoping to avoid!
>
>Thanks... I'm on my way to wrapping this up.

Hi Eric,

The CommandType.Text parameter (overload) is used when you want to access data with a different method than specified in your business object. If you have CommandType set in your ABusinessObject as CommandType.StoredProcedure than yes you need to use that parameter to set it differently. On the other hand, if your special business object is only going to be using type Text, then you can just set Command Type on that business object to CommandType.Text and not have to use the parameter overload each time. I hope that makes sense.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform