Set update parameter default value in code behind: Formview …. Meeting Time: <asp:textbox ID=”TimeTextBox” runat=”server” Text=’< %# Bind("Time") %>‘ /> … <updateparameters> <asp:parameter Name=”Time” Type=”String” /> <asp:parameter Name=”Rid” Type=”Int32″ /> </updateparameters> </asp:textbox> Code behind Protected Sub MemberDetailFV_ItemUpdating(ByVal sender As Object, ByVal_ e As System.Web.UI.WebControls.FormViewUpdateEventArgs)_ Handles MemberDetailFV.ItemUpdating_ MemberDetailDS.UpdateParameters(“Time”).DefaultValue = Now() End Sub
Archive for the 'Parameters' Tag
SQL Primary Key Constraint on alter table
– Login to your server MS SQL Management Studio Express – Expand the database; expand the tables folder, right click on the table “[your table name]”, click “Open Table.” Make sure the primary key column(s) have been declared to not contain NULL values (when the table was first created). With the open table click on […]
VB.NET – Parameters
Parameter default value in code behind SQL Datasource <asp:sqldatasource ID=”ServiceExpired” runat=”server” ConnectionString=”< %$ ConnectionStrings:intranetConnectionString2 %>” SelectCommand=”SELECT * FROM [Invoice] _ WHERE _ ([EXPIRATION_DATE] >= @EXP_BEG) _ AND _ ([EXPIRATION_DATE] < @EXP_END) _ AND ([EXPIRATION_CONTACT] = @EXPIRATION_CONTACT) _ ORDER BY _ EXPIRATION_DATE "> <selectparameters> <asp:parameter DefaultValue=”YES” Name=”EXPIRATION_CONTACT” Type=”String” /> <asp:parameter Name=”EXP_BEG” Type=”DateTime”/> <asp:parameter Name=”EXP_END” Type=”DateTime”/> </selectparameters> […]