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>&lt;MM:Update
runat="server"
CommandText='&lt;%# "UPDATE Poll SET PollHit4=?, PollHit3=?, PollHit1=?, PollHit2=? WHERE PollId=?" %&gt;'
ConnectionString='&lt;%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_db" %&gt;'
DatabaseType='&lt;%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_db" %&gt;'
Expression='&lt;%# Request.Form("MM_update" = "form1" %&gt;'
CreateDataSet="false"
Debug="true"
&gt;
&lt;Parameters&gt;
&lt;Parameter Name="@PollHit4" Value='&lt;%# IIf((Request.Form("Hdn4" &lt;&gt; Nothing), Request.Form("Hdn4", "" %&gt;' Type="Integer" /&gt;
&lt;Parameter Name="@PollHit3" Value='&lt;%# IIf((Request.Form("Hdn3" &lt;&gt; Nothing), Request.Form("Hdn3", "" %&gt;' Type="Integer" /&gt;
&lt;Parameter Name="@PollHit1" Value='&lt;%# IIf((Request.Form("Hdn1" &lt;&gt; Nothing), Request.Form("Hdn1", "" %&gt;' Type="Integer" /&gt;
&lt;Parameter Name="@PollHit2" Value='&lt;%# IIf((Request.Form("Hdn2" &lt;&gt; Nothing), Request.Form("Hdn2", "" %&gt;' Type="Integer" /&gt;
&lt;Parameter Name="@PollId" Value='&lt;%# IIf((Request.Form("HdnID" &lt;&gt; Nothing), Request.Form("HdnID", "" %&gt;' Type="Integer" /&gt;
&lt;/Parameters&gt;
&lt;/MM:Update&gt;[/i]
</font id=code></pre id=code>
Has someone an idea how i can run the Update command thrue the Sub Procedure.

Thanks!!!

Reply to this topic