CODE
Imports System.Data.SqlClient
Partial Class Feedbacks
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
txtName.Text = txtName.Text.Replace("'", "''")
txtEmail.Text = txtEmail.Text.Replace("'", "''")
TxtFeedbackDesc.Text = TxtFeedbackDesc.Text.Replace("'", "''")
Dim FeedbackId As String = Session("FeedbackId")
If (FeedbackId = "") Then
FeedbackId = createFeedbackId()
Session("FeedbackId") = FeedbackId
End If
End Sub
Function createFeedbackId() As String
Dim connectionString As String = _
ConfigurationManager.ConnectionStrings("FeedbackConnectionString").ConnectionString
Dim connection As SqlConnection = New SqlConnection(connectionString)
connection.Open()
Dim sql As String = "INSERT INTO Feedback(FeedbackID,Name,Email,FeedbackDesc) VALUES('" & txtName.Text.Trim & "','" & TxtEmail.Text.Trim & "','" & TxtFeedbackDesc.Text.Trim & "');"
Dim command As SqlCommand = New SqlCommand(sql, connection)
connection.Close()
End Function
End Class
the when i submit this feedback,the recorde is not inserted into the databasae.help out please!
This post has been edited by Fusion.01: 18 Jun, 2009 - 02:17 AM