Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Is there a problem with this code?

  Asked By: Steven    Date: Jun 27    Category: Asp.net    Views: 855
  

Below is the code I am using to delete a certain set of records,


Dim conPrepaid2 As SqlConnection
Dim strDelete As String
Dim cmdDelete As SqlCommand
Dim records_deleted As Integer
Dim conn_string As String

conPrepaid2 = New
SqlConnection("Server=localhost;UID=abc;PWD=sec;database=prep")
strDelete = "Delete From temp_radonline Where nasidentifier LIKE @nas"
cmdDelete = New SqlCommand(strDelete, conPrepaid2)
conPrepaid2.Open()
records_deleted = cmdDelete.ExecuteNonQuery()
conPrepaid2.Close()
Label1.Text = records_deleted

I used to drop a Datadapter and a dataset on form and have used it for
displaying, modifification and insertion, donno how can use them to delete, by
the way is the code ok to delet records?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Is there a problem with this code? Or get search suggestion and latest updates.




Tagged: