Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.net SQL Parameter Query errors

Posted on 2011-02-21
7
Medium Priority
?
550 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

596 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