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
Solved

ASP.net SQL Parameter Query errors

Posted on 2011-02-21
7
520 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:murbro
  • 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:murbro
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 143

Expert Comment

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

Author Comment

by:murbro
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:murbro
ID: 35122296
The line where I pass the variable was the issue. thanks
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 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