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.comwww.prenia.comWeblog: blogs.prenia.com/cathi