I am having problems with a dataset that calls an SQL 2000 stored procedure.
Each time the page loads, a record is inserted, then when I hit the submit button a second record is inserted. Is there a way I can specify that a dataset is to load only if a certain condition is true? e.g. the form has been submitted
Here's what I've tried, but with no success. Am I close, or shoudl I scrap this and find a better method?
Each time the page loads, a record is inserted, then when I hit the submit button a second record is inserted. Is there a way I can specify that a dataset is to load only if a certain condition is true? e.g. the form has been submitted
Here's what I've tried, but with no success. Am I close, or shoudl I scrap this and find a better method?
Code:
<MM:If runat="server" Expression='<%# If((Request.Form("submit") = "") then Response.Redirect("change.sec.adm2.aspx") %>'>
<ContentsTemplate>
<MM:DataSet
runat="Server"
id="sg_supportRequestInsert"
IsStoredProcedure="true"
CreateDataSet="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Intranet_DB") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Intranet_DB") %>'
CommandText="dbo.sg_supportRequest_insert"
Debug="true">
<Parameters>
<Parameter Name="@req_type_id" Value='<%# IIf((Request.Form("req_type_id") <> Nothing), Request.Form("req_type_id"), "") %>' Type="VarChar" Direction="Input" />
<Parameter Name="@dep_nameShort_id" Value='<%# IIf((Request.QueryString("dep") <> Nothing), Request.QueryString("dep"), "") %>' Type="VarChar" Direction="Input" />
<Parameter Name="@submittedBy" Value='<%# IIf((Not Session("AUTH_USER") Is Nothing), Session("AUTH_USER"), "BI\") %>' Type="VarChar" Direction="Input" />
</Parameters>
</MM:DataSet>
</ContentsTemplate>
</MM:If>