Last post May 28, 2009 01:44 PM by bmains
May 28, 2009 01:21 PM|AppDevForMe|LINK
I need to explicitly load my data source variables and then call the insert method
associated with the data source. The sample VB .net code is listed below.
So is it sufficient for me to just call the Insert() method when I am ready to
insert my values? Or do I need to create an insert event?
You see if I look at the properties window for the data source, there is a lightning bolt
icon that will generate events for the data source such as Insert,Inserting,Disposing,Init,Load etc.
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs)
May 28, 2009 01:44 PM|bmains|LINK
I create the InsertCOmmand object and the insert parameters in the markup. Then, I would do:
Me.SqlDataSource1.InsertParameters["Title"].DefaultValue = "Mr."
Setting the DefaultValue is one way of doing it. You would have to ensure you clear the parameters every time you click save with the current approach.