Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LoadRow
Message
 
À
31/08/2009 18:42:39
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
01415120
Message ID:
01422047
Vues:
47
Thanks, guys. This framework is so awesome, I just assumed it would have something like "load this pk's data into an entity" without me having to recreate it each time. LoadRow() sure seemed right. Bob, it kept giving me the error that started the thread (waaaay back).

I'll just keep doing what I'm doing. I've noticed that if something seems hard, I'm not doing it right.

Eric

>Load Row is not for that type of use Eric. What you have below for your Select by PK is perfect and how I would do it also.
>Tim
>
>>I'm coming back to this. I've worked around it using your suggestions below (thanks guys!), but I gotta think something's not quite right for this not be working out of the box.
>>
>>I just created a brand new using the MM.Net Business Layer Generator. It's a nice table with a primary key, nothing hard. I look in the data access class and there are perfect functions for creating select, update, delete, insert, and selectByPk commands. All looks good.
>>
>>If I instantiate the object and call any of the object's data access commands, they all work fine except loadRow.
>>
>>getEntityList(), deleteEntity(), they're all great. I've been creating my own getEntityByPK, which is what I expect loadRow() to be, like this:
>>
>>
>>public ContactEntity getContactByID(int iId)
>>        {
>>            return this.GetEntity("ContactSelectByPK",
>>                this.CreateParameter("@numIndID", iId));
>>        }
>>
>>
>>but shouldn't loadRow() work? Am I using the wrong method()?
>>
>>Eric
>>
>>
>>
>>
>>
>>
>>>Eric,
>>>
>>>You can also set that differently at the specific business object if you have one that needs to use different command type than the application default. Then if you want to use say Stored Procedures but have just one method where you want to use a command string you can use one of the overloads like this.
>>>
>>>
>>>    return this.GetEntityList("SELECT * FROM Customer", CommandType.Text);
>>>
>>>
>>>Gives you lots of options
>>>Tim
>>>
>>>
>>>>Is this what you're looking for?
>>>>
>>>>
>>>>
>>>>public ABusinessObject()
>>>>        {
>>>>            this.DatabaseKey = "DBName";
>>>>            this.RetrieveAutoIncrementPK = true;
>>>>            this.DefaultCommandType = CommandType.StoredProcedure;
>>>>            this.AutoSaveOnParentSaved = true;
>>>>        }
>>>>
>>>>
>>>>>I must have something not set quite right. When I invoke any entity's loadRow() method, it's failing. Digging into it, the method appears to build a perfect command string for what I need, but then when it calls loadDataSet() its sends the CommandType parameter as a StoredProcedure, rather than a command. Where's the setting to say that it's not a stored procedure?
>>>>>
>>>>>Thanks,
>>>>>
>>>>>Eric
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform