Solved

ASP.net SQL Parameter Query errors

Posted on 2011-02-21
7
510 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 142

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 142

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 142

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now