Forums
This topic is locked
MM Update After Procedure. [HELP!]
Posted 03 May 2007 21:27:34
1
has voted
03 May 2007 21:27:34 steven Macquoy posted:
I want to excecute MMupdate after an if function. When i Click the button the db is updated but the values are incorrect because the if function did not run!
My Code:
<pre id=code><font face=courier size=2 id=code>Sub BtnVote (Src As Object, E As EventArgs)
If rb1.Checked = True
Session("Hits01" = Session("Hits01" + 1
Else if rb2.Checked = True
Session("Hits02" = Session("Hits02" + 1
End if
End Sub</font id=code></pre id=code>
The MM Update:
<pre id=code><font face=courier size=2 id=code><MM:Update
runat="server"
CommandText='<%# "UPDATE Poll SET PollHit4=?, PollHit3=?, PollHit1=?, PollHit2=? WHERE PollId=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_db" %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_db" %>'
Expression='<%# Request.Form("MM_update" = "form1" %>'
CreateDataSet="false"
Debug="true"
>
<Parameters>
<Parameter Name="@PollHit4" Value='<%# IIf((Request.Form("Hdn4" <> Nothing), Request.Form("Hdn4", "" %>' Type="Integer" />
<Parameter Name="@PollHit3" Value='<%# IIf((Request.Form("Hdn3" <> Nothing), Request.Form("Hdn3", "" %>' Type="Integer" />
<Parameter Name="@PollHit1" Value='<%# IIf((Request.Form("Hdn1" <> Nothing), Request.Form("Hdn1", "" %>' Type="Integer" />
<Parameter Name="@PollHit2" Value='<%# IIf((Request.Form("Hdn2" <> Nothing), Request.Form("Hdn2", "" %>' Type="Integer" />
<Parameter Name="@PollId" Value='<%# IIf((Request.Form("HdnID" <> Nothing), Request.Form("HdnID", "" %>' Type="Integer" />
</Parameters>
</MM:Update>[/i]
</font id=code></pre id=code>
Has someone an idea how i can run the Update command thrue the Sub Procedure.
Thanks!!!