what is the difference?

threeo

Member
Joined
May 26, 2010
Messages
15
Programming Experience
1-3
i have two procedures that essentially should do the same thing.
one works.
one doesn't.
i'm trying to figure out why the second one doesn't work like the first one.

what i'm doing is this:
i have a form with some input fields.
the user fills in the input fields and clicks a button and a new record should be created in the database with the data in the input fields.

the way i do it is like this:
i have a dataset.
when the user clicks "insert new record"
i create a new row in the dataset and then run the "update" on the dataset.
the first one works just fine.
the second one bombs and says it is expecting the input parameters.
but the input parameters should already be in the row that is being added.

here's how it looks:
VB.NET:
                Dim newRow As dsLogin.tbnAllUsersRow
                newRow = DsLogin.tbnAllUsers.NewtbnAllUsersRow

                newRow.Accounting = Me.cbAccounting.Checked
                newRow.Admin = Me.cbAdmin.Checked
                newRow.Email = Me.txtEmail.Text
                newRow.FullName = Me.txtFname.Text & " " & Me.txtLname.Text
                newRow.UserName = Me.txtUser.Text

                Me.DsLogin.tbnAllUsers.Rows.Add(newRow)
                UpdateMain()
and here's how UpdateMain looks:
VB.NET:
        Me.Validate()
        Me.TbnAllUsersBindingSource.EndEdit()
        Me.taAllUsers.Update(Me.DsLogin.tbnAllUsers)
this approach works perfectly for one form but the second form expects each individual input parameter.

when i examine the "update" part.....the working example has 4 pieces:
VB.NET:
dataTable As PEP_RMS.dsLogin.tbnAllUsersDataTable
dataSet As PEP_RMS.dsLogin
dataRow As System.Data.DataRow
dataRows() As System.Data.DataRow
the one that doesn't work has exactly the same 4 pieces with one additional piece....
VB.NET:
dataTable As PEP_RMS.dsSalesPackages.tblSalesPackageDataTable
dataSet As PEP_RMS.dsSalesPackages
dataRow As System.Data.DataRow
dataRows() As System.Data.DataRow
SP_ID As Integer?, UserName As Varchar..... (continues to list each of the input fields)

so my question is......
why does the second form require the individual input parameters but the first does not???
 
Last edited by a moderator:
I've read your post twice but can't really make sense of it, and it doesnt include any exact error messages, just reinterpretations of them (is it "No value supplied for one or more required parameters" ?)

Can you post a project that demonstrates the problem, or explain it better?
 
Back
Top