|
liping
Starting Member
2 Posts |
Posted - 2008-01-17 : 09:15:24
|
| Hi, I hav this error when I try to delete/edit the user information from database using the SQLDataSource. Pls Help Me!! Thank you! Protected Sub bn_reset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bn_reset.Click tb_name.Text = "" tb_add.Text = "" tb_telNo.Text = "" tb_birth.Text = "" tb_email.Text = "" tb_nameCredit.Text = "" tb_expiry.Text = "" tb_cardNo.Text = "" tb_cvvCode.Text = "" tb_bank.Text = "" tb_loginId.Text = "" tb_pswd.Text = "" tb_confirmPswd.Text = "" End Sub Protected Sub bn_submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bn_submit.Click Session("myLoginId") = tb_loginId.Text Session("myPassword") = tb_pswd.Text Dim cn As New SqlClient.SqlConnection() cn.ConnectionString = ConfigurationManager.ConnectionStrings("CustomerCS").ConnectionString Dim sql As String sql = "Insert into CustomerTable(Name,Gender,Address,Telephone,Birthdate,Email,[Name(Credit Card)],[Credit No],[Expiry date],[CVV2/CVC2 code],[Credit Card Bank],[Login ID],Password)" sql = sql & "Values (@pName,@pGender,@pAdd,@pTel,@pBirth,@pEmail,@pNameCredit,@pCreditNo,@pExp,@pCode,@pBank,@pLogin,@pPswd)" Dim cmd As New SqlCommand(sql, cn) cmd.Parameters.AddWithValue("@pName", tb_name.Text) cmd.Parameters.AddWithValue("@pGender", rb_gender.SelectedValue) cmd.Parameters.AddWithValue("@pAdd", tb_add.Text) cmd.Parameters.AddWithValue("@pTel", tb_telNo.Text) cmd.Parameters.AddWithValue("@pBirth", tb_birth.Text) cmd.Parameters.AddWithValue("@pEmail", tb_email.Text) cmd.Parameters.AddWithValue("@pNameCredit", tb_nameCredit.Text) cmd.Parameters.AddWithValue("@pCreditNo", tb_cardNo.Text) cmd.Parameters.AddWithValue("@pExp", tb_expiry.Text) cmd.Parameters.AddWithValue("@pCode", tb_cvvCode.Text) cmd.Parameters.AddWithValue("@pBank", tb_bank.Text) cmd.Parameters.AddWithValue("@pLogin", tb_loginId.Text) cmd.Parameters.AddWithValue("@pPswd", tb_pswd.Text) cn.Open() cmd.ExecuteNonQuery() cn.Close() cmd.Dispose() cn.Dispose() Response.Redirect("Confirmation.aspx") End SubEnd Class |
|