LLBLGenProDataSource and formview

Posts   
 
    
jovball
User
Posts: 443
Joined: 23-Jan-2005
# Posted on: 11-Dec-2006 19:21:41   

I've done some searching through the reference manual and the forums without any real success. Can someone confirm the following items for me?

1) Is is possible to retrieve an identity value or fetch the record that has just been inserted using a formView control if LivePersistence is True?

2) Is there a way to use output parameters with LLBLGenProDataSource2? The designer allows you to specify output parameters but I don't see them when I use Profiler.

Joel Reinford Data Management Solutions LLC

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 12-Dec-2006 08:06:59   

1) Is is possible to retrieve an identity value or fetch the record that has just been inserted using a formView control if LivePersistence is True?

You can use the Refetch() method of the LLBLGenPro datasource.

The designer allows you to specify output parameters but I don't see them when I use Profiler.

Would you please elaborate more? I can't see where you can specify the output parameters?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 12-Dec-2006 10:40:41   

To elaborate a bit on the insert part: the entity you add using a formview is added to the collection in the datasourcecontrol. I'm not sure if you use it in combination of a gridview but if that's the case, the new entity is added automatically to the grid as well. For an example of this, please check the HnD source code (http://www.llblgen.com/HnD ), in the Admin section of the HnD GUI project, IP Ban management form for example.

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 443
Joined: 23-Jan-2005
# Posted on: 12-Dec-2006 13:37:51   

OK, I'll look at HnD and see what I can figure out from that. I'm glad that we have an example for ASP.NET.

Walaa: If you go into the properties window of the datasource control and go into the Select parameters collection. The advanced properties of the Parameter Collection Editor have an option for the parameter direction.

Frans: BTW, I've learned that adding a pages element in web.config can be a nice timesaver. You can automatically add namespaces so you don't have to add the using/imports lines to each .cs/.vb file. You can also add the llblgenproDataSource control so that you don't need the @ Register Assembly... on each of the aspx/ascx pages.

See example below.

Joel Reinford Data Management Solutions LLC

<pages>

<!-- Namespaces are case-sensitive-->

<namespaces> <add namespace="SD.LLBLGen.Pro.ORMSupportClasses"/> <add namespace="SD.LLBLGen.Pro.DQE.SqlServer"/>

<add namespace="DMS.MyProject.DAL"/>
<add namespace="DMS.MyProject.DAL.DbSpecific"/>
<add namespace="DMS.MyProject.DAL.EntityClasses"/>
<add namespace="DMS.MyProject.DAL.FactoryClasses"/>
<add namespace="DMS.MyProject.DAL.HelperClasses"/>
<add namespace="DMS.MyProject.DAL.RelationClasses"/>
<add namespace="DMS.MyProject.DAL.TypedViewClasses"/>
<add namespace="DMS.MyProject.DAL.TypedListClasses"/>

</namespaces>

<controls> <add tagPrefix="cc1" namespace="SD.LLBLGen.Pro.ORMSupportClasses" assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20"/> </controls>

</pages>

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 14-Dec-2006 10:28:10   

jovball wrote:

Frans: BTW, I've learned that adding a pages element in web.config can be a nice timesaver. You can automatically add namespaces so you don't have to add the using/imports lines to each .cs/.vb file. You can also add the llblgenproDataSource control so that you don't need the @ Register Assembly... on each of the aspx/ascx pages.

See example below.

Thanks simple_smile

Is it possible to do this automatically? I Mean: what I need is a way to declare this automatically if it's not there. At the moment, the controls have an attribute which defines the tag for them in the page. Not ideal, but works simple_smile

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 443
Joined: 23-Jan-2005
# Posted on: 09-Jan-2007 05:41:58   

Frans:

Sorry, I missed your question earlier, the last month has been ugly in terms of workload.

I see that you used this tip in the new ASP.NET GUI generator, it made me smile.sunglasses

I don't know any way to do this automatically but there might be one. I learned this from using the Peter Blum controls. You might want to drop him a line and see what he can tell you.

Joel Reinford Data Management Solutions LLC

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 09-Jan-2007 09:13:50   

jovball wrote:

Frans:

Sorry, I missed your question earlier, the last month has been ugly in terms of workload.

I see that you used this tip in the new ASP.NET GUI generator, it made me smile.sunglasses

Yes! smile .

I don't know any way to do this automatically but there might be one. I learned this from using the Peter Blum controls. You might want to drop him a line and see what he can tell you.

Joel Reinford Data Management Solutions LLC

Ok simple_smile Thanks again for the tip simple_smile

Frans Bouma | Lead developer LLBLGen Pro