Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am learning ASP.NET, so please bear with me.

Using Visual Studio.NET I have three pages, an .aspx, .vb, and .aspx.vb. My .aspx page has text boxes, check boxes and a drop down list. The .vb has the class in which I wrote a function to insert records into the database. The .vb is located in another folder from the .aspx and .aspx.vb folder.

 

Using the click event of the submit button on the .aspx page I would like to call the insert function I created.

 

On the .aspx.vb page I am getting an error on the last line of this sub which reads [Argument not specified for parameter 'e' of 'Public Function insertNewDataPerformanceMeasures(sender As Object, e As System.EventArgs) As TestGale411.clPerfGroupMeasures'.]

 

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Dim newPerformanceMeasure As New clPerfGroupMeasures()

 

newPerformanceMeasure.insertNewDataPerformanceMeasures()

End Sub

 

What does this error message mean and how do I fix the problem?

 

TY

LadyGail

Posted

This the insertNewDataPerformanceMeasures function.

 

Public Function insertNewDataPerformanceMeasures(ByVal sender As System.Object, ByVal e As System.EventArgs) As clPerfGroupMeasures

Dim newPerformanceMeasure As New clPerfGroupMeasures()

Dim sqlInsert As New SqlCommand()

Dim conn As SqlConnection = setConnection()

sqlInsert.CommandText = "Insert Into PerformanceMeasures " _

& " (PerfNum, TrackingDivision, PerformanceMeasures, TypeCode1, TypeCode2 " _

& " SuggestedPerformance, Qtr_OneResults, Qtr_TwoResults, Qtr_ThreeResults, Qtr_FourResults " _

& " Comments, GroupCode, Total, DivisionCode, AuthorizedUser1, AuthorizedUser2) values (" _

& " (10, ddlGroup.SelectedItem.Value, txtTrackingDivision.Text, txtPerformanceMeasures.Text, " _

& " chkCS.SelectedValue, chkED.SelectedValue, chkFIN.SelectedValue, chkQLTY.SelectedValue, txtPerformanceTarget.Text, " _

& " txtPerformanceTarget.Text, txtQtr1.Text, txtQtr2.Text, txtQtr3.Text, txtQtr4.Text, " _

& " txtComments.Text, txtGroup.Text, txtTotal.Text, 16, txtAuthorizedUser1.Text, txtAuthorizedUser1.Text) "

 

sqlInsert.Connection = conn

sqlInsert.Connection.Open()

sqlInsert.ExecuteNonQuery()

closeDatabase(conn)

 

End Function

  • Administrators
Posted

Public Function insertNewDataPerformanceMeasures(ByVal sender As System.Object, ByVal e As System.EventArgs) As clPerfGroupMeasures

Is there a reason for thee sender and parameters? they are normally associated with an event handler rather than a functioin / sub.

 

If you delete them from the definition things should work okay...

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...