Forum
smartDBforms.NET for ASP.NET 2
 
 
Knowledge Base Forum
To post messages on the forum, you need to login first.
SearchForum Home
  Product Forums  smartDBforms.NET  Different layou...
 Different layout when inserting
 
 7/16/2008 1:32:09 PM
DANIEL
2 posts


Different layout when inserting

Hi,
I want my form when user clicks insert to show only some of the database fields. The layout should also be different. Is this possible? Now the same layout is used when editing and creating new records.
Best regards:
Daniel

 7/17/2008 10:43:58 AM
Adillis Support
27 posts
adillis.com


Re: Different layout when inserting
Hi Daniel,

You can have different layout and different fields in insert mode. This can be achieved by using a separate template for insert mode in SmartDBView.

   1. In design time open your form and open the SmartDBView smart-tag panel.
   2. Click on the "Separate Insert Template" check box.
   3. You will have the option to start with an empty Insert template to to reuse the existing template.
   4. You can edit the template by changing the DefaultMode property to Insert or using the 'Edit Templates' smart-tag command.


Also you need to modify your Insert sql statement in SmartDataSource to insert only the columns which you will use in the Insert template.

If you have any other questions, we will be more than happy to help you.
Best wishes,
Adillis Support
Adillis - IT solutions http://adillis.com


 7/21/2008 12:06:04 PM
DANIEL
2 posts


Re: Different layout when inserting
This is cool. It worked. I need to execute two insert SQLs when the user presses the insert button. How to do it? I use SQL Server. The first insert is the normal one and the second will insert the same data in a shadow table.
Daniel
 7/22/2008 10:36:20 AM
Adillis Support
27 posts
adillis.com


Re: Different layout when inserting
Hi Daniel,

You can easily do it. Just edit the SmartDataSource Insert command and add your second insert statement at the end. In the new insert statement you can use the same parameters that are used in the first insert statement. Take into account that only the System.Data.SqlClient provider supports naming parameters. If you are using System.Data.OleDb provider then for the second insert statement you will have additional parameters which you should take care to be filled with data at the moment of insert.

If you have any other questions, we will be more than happy to help you.
Best wishes,
Adillis Support
Adillis - IT solutions http://adillis.com


  Product Forums  smartDBforms.NET  Different layou...
Copyright 2006-2008 Adillis Terms Of Use Feedback Contact Us