|
-
Dec 28th, 2007, 08:50 PM
#1
Thread Starter
Addicted Member
-
Dec 29th, 2007, 03:51 AM
#2
Re: Update DataTable
You're trying to set a field of a nonexistent DataRow. Look at this code:
Code:
Dim DataRow As Data.DataRow
DataRow("denumire") = Me.txt_denumire_unitate.Text
The first line declares a variable named "DataRow" that is type DataRow. Congratulations, you now have a variable that CAN refer to a DataRow object but at the moment refers to Nothing. The next line tries to set the "denumire" column of the DataRow object referred to by that variable to a value. If the variable doesn't refer to a DataRow object though, how can you set a field?
Think about this. If you go and build a garage on the side of your house, does that mean that you can just jump in and drive the car it contains? Of course not. You have actually put a car inside it first. Just because you've got somewhere to put a car doesn't mean you've got a car. Likewise, just because you've got a variable that can refer to a DataRow doesn't mean you've got a DataRow.
Also, this line is completely meaningless:
Code:
(Me.Ibooks_datele_unitatii_DataSet, "datele_unitatii").EndCurrentEdit()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|