Solved

ASP.net SQL Parameter Query errors

Posted on 2011-02-21
7
517 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

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…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

772 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