-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: BanupriyaVelmurugan
Message 1 in Discussion

Hi   I have the code to delete a record that is already selected in the asp.net page.  
  But the record is not being deleted from the database even though I get the result 
as "Record deleted successfully".    The code as follows:   Private Sub 
btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles 
btnDelete.Click  
Try 
Dim myQuery As String = "delete from birthday where id=" & UpdateID 
Dim myCmd As SqlCommand = New SqlCommand(myQuery, SqlConnection1) 
SqlConnection1.Open() 
myCmd.ExecuteNonQuery() 
lblResult.ForeColor = Color.Blue 
lblResult.Text = "Record deleted successfully!" 
Catch ex As Exception 
lblResult.ForeColor = Color.Red 
lblResult.Text = ex.Message.ToString() 
Finally 
SqlConnection1.Close() 
txtEmail.Text = "" 
txtName.Text = "" 
drpYear.SelectedValue = Year(Now) 
drpMonth.SelectedValue = Month(Now) 
drpDay.SelectedValue = Day(Now) 
btnDelete.Enabled = False 
End Try 
End Sub 
Can any one please say me why the record is not deleted even I get the result "Record 
deleted successfully"? 
Thanks 
Banu

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to