[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

reference data

Posted on 2015-02-02
10
Medium Priority
?
92 Views
Last Modified: 2015-02-09
Here is my code:

 Private Sub frmCompInfo_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        'TODO: This line of code loads data into the 'CompanyInfo._CompanyInfo' table. You can move, or remove it, as needed.
        Me.CompanyInfoTableAdapter.Fill(Me.CompanyInfo._CompanyInfo)

    End Sub

then I go to update it off of a Save Button

Me.CompanyInfoTableAdapter.Update(Me.CompanyInfo._CompanyInfo.GetChanges)

AND I get this error

argument null exception was unhandled
 vb.net vs2012
0
Comment
Question by:MBHEY131
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
10 Comments
 
LVL 23

Expert Comment

by:Michael Fowler
ID: 40585344
It sounds like one of the objects in the offending line has not been initiated.

Place a break point at this line and then check the values of the objects in the call.
0
 

Author Comment

by:MBHEY131
ID: 40585381
I tried that and all looks well
It loads to the form and all textboxes that it's bound to

<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
         Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
         Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
        Public Overridable Overloads Function Update(ByVal dataTable As CompanyInfo.CompanyInfoDataTable) As Integer
            Return Me.Adapter.Update(dataTable) <<< Errors out here the datatable is nothing
        End Function

but it's passed from here

 Me.CompanyInfoTableAdapter.Update(Me.CompanyInfo._CompanyInfo.GetChanges)

I mouse over and the data is in the ta and the ds and dt??? all have proper data
I'm stumped Which doesn't take to much.
0
 
LVL 23

Expert Comment

by:Michael Fowler
ID: 40585393
You are passing the results of the method GetChanges not the datatable itself. What happens if you pass just Me.CompanyInfo._CompanyInfo.
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

Author Comment

by:MBHEY131
ID: 40585416
Well I don't get any errors and it seems to bring over the data table name correctly
But it will not update any changes I make to the table???

that's progress anyway - what do I do now?
0
 
LVL 23

Assisted Solution

by:Michael Fowler
Michael Fowler earned 2000 total points
ID: 40585421
Update the table then pass it to the function eg

Me.CompanyInfo._CompanyInfo.GetChanges
Me.CompanyInfoTableAdapter.Update(Me.CompanyInfo._CompanyInfo)

Open in new window

0
 

Author Comment

by:MBHEY131
ID: 40585457
everything seems to be going where it should and be in the proper places
But - it still will not push the changes to the data table in the database????
0
 

Author Comment

by:MBHEY131
ID: 40585459
table gets updated properly because I have it on the scope in the debugger, but no dice.
0
 

Author Comment

by:MBHEY131
ID: 40587023
Does anybody have any other  advice - this issue is holding up my whole project basically
Should I populate straight from a SQL
0
 

Accepted Solution

by:
MBHEY131 earned 0 total points
ID: 40589724
SOLVED:
In my situation you need to call:
     
  Me.CompanyInfoBindingSource.EndEdit()

        before:

        Me.CompanyInfo._CompanyInfo.GetChanges()
        Me.CompanyInfoTableAdapter.Update(Me.CompanyInfo._CompanyInfo)

And much joy will be had!!!
0
 

Author Closing Comment

by:MBHEY131
ID: 40597963
Me.CompanyInfo._CompanyInfo.GetChanges()
        Me.CompanyInfoTableAdapter.Update(Me.CompanyInfo._CompanyInfo)

Got me on the right track
But:

        Me.CompanyInfoBindingSource.EndEdit()

Needed to be added
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question