Hi
I'm using rad grid and implemented parameters for insert,update and where.
But created parameters for update not updated the database. Insert and where parameters are working perfectly.
Please look at the code how I implemented in the project,
I'm using rad grid and implemented parameters for insert,update and where.
But created parameters for update not updated the database. Insert and where parameters are working perfectly.
Please look at the code how I implemented in the project,
<asp:LinqDataSource ID="ldsDList" runat="server" <br> ContextTypeName="MDataContext" <br> EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName="" <br> TableName="DLists"><br> <InsertParameters><br> <asp:ControlParameter ControlID="HFUser" Name="EnteredBy" <br> PropertyName="Value" Type="Int32" /><br> <asp:Parameter Name="DateEntered" Type="DateTime" /><br> </InsertParameters><br> <UpdateParameters><br> <asp:ControlParameter ControlID="HFUser" Name="ModifiedBy" <br> PropertyName="Value" Type="Int32" DbType="Int32" /><br> <asp:Parameter Name="DateModified" Type="DateTime" /><br> </UpdateParameters><br> </asp:LinqDataSource>Protected Sub ldsDList_ContextCreating(sender As Object, e As System.Web.UI.WebControls.LinqDataSourceContextEventArgs) Handles ldsDList.ContextCreating<br> If e.Operation = DataSourceOperation.Insert Then<br> Me.ldsDList.InsertParameters("DateEntered").DefaultValue = DateTime.Now.ToString()<br> ElseIf e.Operation = DataSourceOperation.Update Then<br> Me.ldsDList.UpdateParameters("DateModified").DefaultValue = DateTime.Now.ToString()<br> End If<br> End Sub