Ignore my previous post. I misread your question.
You need to provide us with some of your database logic, at the moment
your telling us nothing about how you are achiving the database insert,
or any structure of the table concerned.- Hide quoted text -
- Show quoted text -
Sorry about that... here's the code behind page:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim question As String = TxtQuestion.Text
Dim answer As String = TxtAnswer.Text
Dim CDPPin As String = Session("GetPin")
Dim displayedQues As Char = "Y"
Dim nonDisplayedQues As Char = "N"
Dim conn As New Data.SqlClient.SqlConnection("Data
Source=seb2a54;Initial Catalog=EDCSFAQS;Persist Security
Info=True;User ID=EDCSFAQUser;Password=fax") 'this is the conn from
frontpage
If (RadioYes).Checked = True Then
displayedQues = "Y"
Else : displayedQues = ""
End If
If (RadioNo).Checked = True Then
nonDisplayedQues = "N"
Else : nonDisplayedQues = ""
End If
Dim cmd As New Data.SqlClient.SqlCommand
With cmd
.Connection = conn 'the connection
.CommandType = Data.CommandType.StoredProcedure
.CommandText = "EnterAdminQuestion"
.Parameters.AddWithValue("@topicid",
CInt(DropDownList1.SelectedItem.Value))
.Parameters.AddWithValue("@quesdate", QuesDate.Text)
.Parameters.AddWithValue("@questions", TxtQuestion.Text)
.Parameters.AddWithValue("@Answer", TxtAnswer.Text)
.Parameters.AddWithValue("@DisplayedQues", displayedQues)
.Parameters.AddWithValue("@NonDisplayedQues",
nonDisplayedQues)
.Parameters.AddWithValue("@CDPPin", CDPPin)
End With
Try
conn.Open()
cmd.ExecuteNonQuery()
Catch ex As Data.SqlClient.SqlException
Throw New ApplicationException("An error occurred while
trying to insert the record")
Finally
conn.Close()
End Try
Lbloutcome.Text = "Your entry was submitted into the
database."
End Sub