LadyGail Posted February 18, 2004 Posted February 18, 2004 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 Quote
Administrators PlausiblyDamp Posted February 18, 2004 Administrators Posted February 18, 2004 What does the .insertNewDataPerformanceMeasures function look like? It appears you are not passing in the required parameters Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
LadyGail Posted February 18, 2004 Author Posted February 18, 2004 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 Quote
Administrators PlausiblyDamp Posted February 18, 2004 Administrators Posted February 18, 2004 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... Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
LadyGail Posted February 18, 2004 Author Posted February 18, 2004 Thank you, that error has been erased and replace with something else, an unhandled exception error I am trying to track down. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.