R
Radu
Hi. I have the following puzzle:
I have in the DB a table name "Login_QAByPIN". In it I'll store, for
identification purposes, 6 questions with 6 answers for each
registered pin. On the registration page, I have the following HTML:
<asp:repeater ID="rptQA" runat="server">
<ItemTemplate>
<tr>
<td><%# Container.DataItem("Q") %></td> <td><asp:TextBox
ID="txtAnswer" runat="server" Width="98%"></asp:TextBox></td> </
tr>
</ItemTemplate>
</asp:repeater>
On registration, the user should be able to enter/edit the answers (in
txtAnswer) and on cmdRegister_Click I want to update my
"Login_QAByPIN" table. The code would be (SNIP):
For intCount = 1 To rptQA.Items.Count
cmd = New SqlCommand(strSprocName, cnSQL)
cmd.CommandType = CommandType.StoredProcedure
objSqlParam = New SqlParameter("@PIN", SqlDbType.NVarChar)
objSqlParam.Value = m_strPIN
cmd.Parameters.Add(objSqlParam)
objSqlParam = New SqlParameter("@QuestionID", SqlDbType.NVarChar)
objSqlParam.Value = intCount
cmd.Parameters.Add(objSqlParam)
objSqlParam = New SqlParameter("@EncryptedAnswer",
SqlDbType.NVarChar)
objSqlParam.Value = EncryptString(CType(rptQA.Items(intCount -
1).Controls(1), TextBox).Text)
cmd.Parameters.Add(objSqlParam)
cmd.ExecuteNonQuery()
Next intCount
My problem is that
CType(rptQA.Items(intCount - 1).Controls(1), TextBox).Text
is always blank.
How do I refer to the data the user entered ? I am not able to
retrieve it !
Thanks a lot for spending the time reading this.
Alex.
I have in the DB a table name "Login_QAByPIN". In it I'll store, for
identification purposes, 6 questions with 6 answers for each
registered pin. On the registration page, I have the following HTML:
<asp:repeater ID="rptQA" runat="server">
<ItemTemplate>
<tr>
<td><%# Container.DataItem("Q") %></td> <td><asp:TextBox
ID="txtAnswer" runat="server" Width="98%"></asp:TextBox></td> </
tr>
</ItemTemplate>
</asp:repeater>
On registration, the user should be able to enter/edit the answers (in
txtAnswer) and on cmdRegister_Click I want to update my
"Login_QAByPIN" table. The code would be (SNIP):
For intCount = 1 To rptQA.Items.Count
cmd = New SqlCommand(strSprocName, cnSQL)
cmd.CommandType = CommandType.StoredProcedure
objSqlParam = New SqlParameter("@PIN", SqlDbType.NVarChar)
objSqlParam.Value = m_strPIN
cmd.Parameters.Add(objSqlParam)
objSqlParam = New SqlParameter("@QuestionID", SqlDbType.NVarChar)
objSqlParam.Value = intCount
cmd.Parameters.Add(objSqlParam)
objSqlParam = New SqlParameter("@EncryptedAnswer",
SqlDbType.NVarChar)
objSqlParam.Value = EncryptString(CType(rptQA.Items(intCount -
1).Controls(1), TextBox).Text)
cmd.Parameters.Add(objSqlParam)
cmd.ExecuteNonQuery()
Next intCount
My problem is that
CType(rptQA.Items(intCount - 1).Controls(1), TextBox).Text
is always blank.
How do I refer to the data the user entered ? I am not able to
retrieve it !
Thanks a lot for spending the time reading this.
Alex.