This is a migrated thread and some comments may be shown as answers.

Need to set Primary Key for insert

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
License Developer
Top achievements
Rank 1
License Developer asked on 30 Jun 2011, 06:15 PM
In our environment, we have an AppSequenceNumber table which maintains the next sequence number or primary key for the next insert of each table in the database, and a stored procedure that returns the sequence number and increments it in the database. Therefore, on each record insert for each of our tables, we must call this stored procedure which updates the AppSequenceNumber table and returns the sequence number which we use as our primary key in the record insert. 

In my application, I am using a popup modal window to handle inserts. How do I capture the submit button click event on this form and call the needed stored procedure to update the database sequence number, insert the sequence number as the primary key, and perform the insert?

I am basing my application on the example at: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultvb.aspx?product=window

Your help is greatly appreciated.
Thank you.

    Chuck 

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 04 Jul 2011, 12:45 PM
Hello,

Since you are basing your implementation on the example mentioned in your post, I suppose you are using a DetailsView control. If so, just attach an event handler to its ItemCommand event and perform you database operations in it. In the ItemCommand event you have access to all the column field values entered by the user.

Hope it helps.

Greetings,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
License Developer
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or