Delete Data

m_nathani

Member
Joined
Apr 15, 2003
Messages
11
Location
india
Hi,
Every body

I have write stored procedure which delete record. In my stored procedure accepted "Uniqueid" parameter and delete record.

In vb.net , I want delete current record through my stored procedure. Uniqueid is not bind with any object . I am using typed dataset.

How to delete record

My code below

Dim Scd As SqlCommand = New SqlCommand("DeleteEmploymaster", Scn)
With Scd
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@uniqueid", SqlDbType.Int, 4, "dsemployee.employmaster.unqiueid") .Value = txtempid.Text
.Parameters("@uniqueid").SourceColumn = "Empid"
End With
DsEmployee.EmployMaster.Rows(Me.BindingContext(DsEmployee.EmployMaster).Position).Delete()
Dim Sda As New SqlDataAdapter(Scd)
Sda.Fill(DsEmployee.EmployMaster)
Sda.Update(DsEmployee.EmployMaster)
Sda.Dispose()
Scn.Dispose()
 
Back
Top