Hi all !

I'm using vs2008, sqlserver2008 and vb.net as language.

I would like to ask, i got this line of error when i'm debugging my code

----Too many arguments to 'Public Function getDrawingNumber(PlcCode As String) As System.Data.DataSet'.----

below is my program code :

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim clsDrawNum As New DrawingNumber()
            Dim dsDraw As DataSet
            Dim PlcCode As String

            dsDraw = clsDrawNum.getDrawingNumber(drpPlaceOfOrig.SelectedValue, PlcCode)

        End Sub

    Public Function getDrawingNumber(ByVal PlcCode As String) As DataSet
        Dim ToEDCConn As New DBConnection("", "TOEDC_Conn")
        Dim ds As DataSet

            ds = ToEDCConn.RunSqlReturnDS("select * from Place where PlaceCode = '" + PlcCode + "'")
            Return ds
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try
    End Function

Anyone here would like to help me to solve this error? :(

Recommended Answers

All 2 Replies

The problem is exactly like the error says. You're trying to pass 2 arguments to a function that only requires 1.

dsDraw = clsDrawNum.getDrawingNumber(drpPlaceOfOrig.SelectedValue, PlcCode)

Hi tinstaafl !

Alright, i try to fixed the error. thank you for your response :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.