Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Re: Delete
Miscellaneous
Thread ID:
00797763
Message ID:
00797794
Views:
21
Hi Mufi,

You need to assign the value of the parameter to be used in the DeleteCommand. Also I would make the capitalization the same for the "@Empid" and the adding of the parameter to the DeleteCommand.
myDataAdapter.DeleteCommand.CommandText = "DELETE FROM Employees WHERE Empid=@Empid"

Dim myparm As SqlParameter = Deletecommand.DeleteCommand.Parameters.Add("@Empid", SqlDbType.Int, "empid").Value = 123456
>hi
>all
>
>hen i delete following error occures.
>
>procedure 'Deleteemploymaster' expects parameter '@Empid', which was not supplied.
>
>My coding ......
>
> Dim Scn As SqlConnection = New SqlConnection(ConnectionString)
> Dim Deletecommand As New SqlDataAdapter("DeleteEmploymaster", Scn)
> Dim myparm As SqlParameter = Deletecommand.DeleteCommand.Parameters.Add("@empid", SqlDbType.Int, "empid")
> DsEmployee.EmployMaster.Rows(Me.BindingContext(DsEmployee.EmployMaster).Position).Delete()
> Deletecommand.Fill(DsEmployee, "employeemaster")
> Deletecommand.Update(DsEmployee, "EmployMaster")
> Deletecommand.Dispose()
> DsEmployee.Dispose()
> Scn.Close()
>
>@empid is rawid it is not binding with objects.
>
>thanks
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform