Solved

ASP.net SQL Parameter Query errors

Posted on 2011-02-21
7
531 Views
Last Modified: 2012-05-11
Hi.

I have written the parameter query shown ithe code below but am getting the following errors:
Error      1      Argument not specified for parameter 'Parameter3' of 'Public Overridable Overloads Function GetDataBy(Parameter1 As String, Parameter2 As String, Parameter3 As String, Parameter4 As String, Parameter5 As String, Parameter6 As String, Parameter7 As String, Parameter8 As String) As DataSet1.Table1DataTable'.      C:\Users\User\Documents\Visual Studio 2010\Projects\GC\GC\Page1.aspx.vb      24      9      GC
Error      2      Argument not specified for parameter 'Parameter4' of 'Public Overridable Overloads Function GetDataBy(Parameter1 As String, Parameter2 As String, Parameter3 As String, Parameter4 As String, Parameter5 As String, Parameter6 As String, Parameter7 As String, Parameter8 As String) As DataSet1.Table1DataTable'.      C:\Users\User\Documents\Visual Studio 2010\Projects\GC\GC\Page1.aspx.vb      24      9      GC
Error      3      Argument not specified for parameter 'Parameter5' of 'Public Overridable Overloads Function GetDataBy(Parameter1 As String, Parameter2 As String, Parameter3 As String, Parameter4 As String, Parameter5 As String, Parameter6 As String, Parameter7 As String, Parameter8 As String) As DataSet1.Table1DataTable'.      C:\Users\User\Documents\Visual Studio 2010\Projects\GC\GC\Page1.aspx.vb      24      9      GC
Error      4      Argument not specified for parameter 'Parameter6' of 'Public Overridable Overloads Function GetDataBy(Parameter1 As String, Parameter2 As String, Parameter3 As String, Parameter4 As String, Parameter5 As String, Parameter6 As String, Parameter7 As String, Parameter8 As String) As DataSet1.Table1DataTable'.      C:\Users\User\Documents\Visual Studio 2010\Projects\GC\GC\Page1.aspx.vb      24      9      GC
Error      5      Argument not specified for parameter 'Parameter7' of 'Public Overridable Overloads Function GetDataBy(Parameter1 As String, Parameter2 As String, Parameter3 As String, Parameter4 As String, Parameter5 As String, Parameter6 As String, Parameter7 As String, Parameter8 As String) As DataSet1.Table1DataTable'.      C:\Users\User\Documents\Visual Studio 2010\Projects\GC\GC\Page1.aspx.vb      24      9      GC
Error      6      Argument not specified for parameter 'Parameter8' of 'Public Overridable Overloads Function GetDataBy(Parameter1 As String, Parameter2 As String, Parameter3 As String, Parameter4 As String, Parameter5 As String, Parameter6 As String, Parameter7 As String, Parameter8 As String) As DataSet1.Table1DataTable'.      C:\Users\User\Documents\Visual Studio 2010\Projects\GC\GC\Page1.aspx.vb      24      9      GC

SELECT        ID, School, [User], [Start date], [Start time], [End date], [End time], Form, House, [Subject or activity], [Age Group], [Sport or activity], Other, [Use]
FROM            Table1
WHERE        (Other LIKE @Parameter1 + '%') AND (School = @Parameter2) AND (USER = @Parameter3) AND (Form = @Parameter4) AND (House = @Parameter5) AND 
                         ([Subject or activity] = @Parameter6) AND ([Age Group] = @Parameter7) AND ([Sport or activity] = @Parameter8)

Open in new window

0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34948991
can you please show more of the relevant code?
visibly, you did not yet code the part to assign the parameters to the command.
0
 
LVL 9

Expert Comment

by:s_chilkury
ID: 34949052
Could you please attach screen shot of the exact error?
0
 

Author Comment

by:Murray Brown
ID: 34949073
SELECT        ID, School, [User], [Start date], [Start time], [End date], [End time], Form, House, [Subject or activity], [Age Group], [Sport or activity], Other, [Use]
FROM            Table1
WHERE        (Other LIKE @Parameter1 + '%') AND (School = @Parameter2) AND (USER = @Parameter3) AND (Form = @Parameter4) AND (House = @Parameter5) AND
                         ([Subject or activity] = @Parameter6) AND ([Age Group] = @Parameter7) AND ([Sport or activity] = @Parameter8)
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34949316
the asp.net relevant part of the code, please
0
 

Author Comment

by:Murray Brown
ID: 34991183
   Protected Sub btnSeeSpecificCalendarItems_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSeeSpecificCalendarItems.Click
        Try

   
        Dim DS1Adapter As New DataSet1TableAdapters.Table1TableAdapter
            Dim oSchool As Object
            If Me.School_DropDownList.SelectedValue = "N/A" Then
                oSchool = System.DBNull.Value
            Else : oSchool = Me.School_DropDownList.SelectedValue
            End If



            GridView1.DataSource = DS1Adapter.GetDataBy("Rugby")

            GridView1.DataBind()

        Catch ex As Exception
            MsgBox("There was an error loading data! " & Err.Description)
        End Try

    End Sub
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34991244
and the code of :

DS1Adapter.GetDataBy () function?

note that your code does set oSchool variable, but doesn't use it (so far) . I presume you pass Rugby as test value?
0
 

Author Closing Comment

by:Murray Brown
ID: 35122296
The line where I pass the variable was the issue. thanks
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question