Dear All,
Can anyone please help me on the following:
I have created a SQL Server stored procedure as follows:
create procedure prcGet_sub_menu_list
@sub_menu char(5)
as
begin
select
'menu_code' = menu_code
'menu_name' = menu_name
from sub_menu_master
where menu_code = @sub_menu
end
return
Now i am calling this procedure from VB.NET, but i get an error like 'Stored procedure prcGet_sub_menu_list expects parameter @sub_menu which was not supplied'. Please help me on the same. The code which i have in VB.NET is as follows:
Imports System.Data
Imports System.Data.SqlClient
Dim sqlConn as New SqlClient.SqlConnection
sqlConn.ConnectionString = "........"
sqlConn.Open()
Dim menuCode as string
menuCode = cboDetails.selectedItem
Dim sqlCmd as New SqlCommand
sqlCmd.Connection = Connection.sqlConn
sqlCmd.CommandType = CommandType.StoredProcedure
sqlCmd.CommandText = "prcGet_sub_menu_list"
sqlCmd.Parameter.Add("menuCode", SqlDbType.Char)
Dim sqlDA as New SqlDataAdapter()
sqlDA.SelectCommand = sqlCmd
Dim sqlDT as New DataTable
sqlDA.Fill(sqlDT)
This is the code that i have written and it gives me the error: 'Stored procedure prcGet_sub_menu_list expects parameter @sub_menu which was not supplied'.
Please give me some help on the same.
Regards, George