hi
this is my coding when i run this coding for display the content in textboxes from the database by click event in datagrid.
"Procedure or Function 'sp_developer_display' expects parameter '@developerid', which was not supplied."
this error will display
my sp in sql express is

ALTER PROCEDURE dbo.sp_developer_display
(
@developerid int
)

AS
/* SET NOCOUNT ON */
select developercode,developername,qualification,dateofjoin,designation,experience,knownsoft from tst_m_developermaste where id=@developerid and tstflag='N'
RETURN

vb.net codin

Dim mydst As New DataSet
MyConnection.ConnectionString = connstring
Dim disp As New SqlDataAdapter("sp_developer_display", MyConnection)
disp.Fill(mydst, "dev_display")

txtdevelopercode.Text = mydst.Tables("dev_display").Rows(0).Item("developercode")
txtdevelopername.Text = mydst.Tables("dev_display").Rows(0).Item("developername")
txtqualification.Text = mydst.Tables("dev_display").Rows(0).Item("qualification")
dtpdateofjoin.Value = mydst.Tables("dev_display").Rows(0).Item("dateofjoin")
txtdesignation.Text = mydst.Tables("dev_display").Rows(0).Item("designation")
txtexperience.Text = mydst.Tables("dev_display").Rows(0).Item("experience")
txtknownsoftware.Text = mydst.Tables("dev_display").Rows(0).Item("knownsoft")
mydst.Dispose()

i need help how to pass parameter to stored procedure for check the id which we get from the datagrid click for display the datas which we get from the database.

Edited 7 Years Ago by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

...

Dim mydst As New DataSet
MyConnection.ConnectionString = connstring
Dim disp As New SqlDataAdapter("sp_developer_display", MyConnection)

disp.SelectCommand.Parameters.AddWithValue("@developerid",10)

disp.Fill(mydst, "dev_display")

...
This article has been dead for over six months. Start a new discussion instead.