hi when i open my form to work with it it comes up this error
i have no idea what to do with it can someone help me


Value cannot be null. Parameter name: objectType


Instances of this error (1)

1. Hide Call Stack

at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.GetRuntimeType(Type objectType)
at System.ComponentModel.TypeDescriptionProvider.GetRuntimeType(Type reflectionType)
at Microsoft.VisualStudio.Design.MultiTargetingContextProvider.GetRuntimeType(Type objectType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.GetFieldType(String fieldName, Type documentBaseType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.GetReferencedComponentType(String componentName, CodeTypeDeclaration codeTypeDecl, ITypeResolutionService loader, IDictionary& cache)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.ParseHandlesClauses(CodeTypeDeclaration codeTypeDecl, Boolean updateCache)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnMethodPopulateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Statements()
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

Recommended Answers

All 3 Replies

Unfortunately the stack trace is of little value to us. Can you post up the code? Although if you debugged it and ran to the error you might get to understand where it is going wrong. From the error message something is null when it shouldn't be.

here is the code

when i run the project the form does not fill so it seems that something is wrong with the tableadapter or rather with the property in the adapter but i can't get what is wrong

Public Class frmEditPerson

  
    Private Sub Edit_Person_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
        'TODO: This line of code loads data into the 'ShullaccountDataSet.membertype' table. You can move, or remove it, as needed.
        Me.MembertypeTableAdapter.Fill(Me.ShullaccountDataSet.membertype)
        'TODO: This line of code loads data into the 'ShullaccountDataSet.members' table. You can move, or remove it, as needed.
        Me.MembersTableAdapter.FillBy(Me.ShullaccountDataSet.members, _
                           Val(frmMain.dgvBasicMemberInfo.Item(1, frmMain.dgvBasicMemberInfo.CurrentRow.Index).ToString))

    End Sub

   


   
    Private Sub FirstLastFatherAddress_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)


        If Not Char.IsLetter(e.KeyChar) And Not Char.IsControl(e.KeyChar) And e.KeyChar <> " " Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtTelZip_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
       Handles mtxtel.KeyPress, ZipTextBox.KeyPress
        If Not Char.IsNumber(e.KeyChar) And Not Char.IsControl(e.KeyChar) And e.KeyChar <> " " Then
            e.Handled = True

        End If
    End Sub

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        If FirstnameTextBox.Text = "" Or LastnameTextBox.Text = "" Then
            MessageBox.Show("First and last name can not be empty", "Add Person", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else

            Dim result As New DialogResult
            result = MessageBox.Show("Are you sure you want to edit this person", "Add Person" _
                        , MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
            If result = Windows.Forms.DialogResult.Yes Then
                Me.Validate()
                Me.MembersBindingSource.EndEdit()
                Me.TableAdapterManager.UpdateAll(Me.ShullaccountDataSet)

                Shull_Account.frmMain.BasicMemberInfoTableAdapter.Fill _
                    (Shull_Account.frmMain.ShullaccountDataSet.BasicMemberInfo)
                frmMain.dgvBasicMemberInfo.Refresh()



                Me.Close()

            End If
        End If
    End Sub



   


End Class

when i comment out the code in the form initialize component the error is still there only when i comment initialize sub it self then the error dissapears

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.