July 10, 2008 at 7:09 am
I have written Stored Procedure TourCount which take tourID as input.
I have written the following code
---------------------------------------------------
Dim con As New SqlConnection("DataSource path")
Dim cmd As New SqlCommand()
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@TourID", 16)
cmd.CommandText = "TourCount"
da.Fill(ds, "Table")
GridControl1.DataSource = ds.Tables(0)
-----------------------------------------------------
but giving an error
Procedure or Function 'TourCount' expects parameter '@Tour', which was not supplied.
How to solve this
July 10, 2008 at 7:29 am
It looks like you actually named the parameter in the stored procedure @tour instead of @TourID. Either change the stored procedure to use @TourID or change the .NET code to use @Tour.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply