Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
PaulNaude #1
I can find it, why can't my code?
I have a problem deleting a record from a table with 3 primary keys, in code.
I get the values of the primary keys from my datagrid displaying the record
to be deleted as follows:
....
findTheseVals(0) = DataGrid4.Item(u, 0) 'First column and unique primary key
(no duplicates allowed)
findTheseVals(1) = DataGrid4.Item(u, 1) 'Second column and primary key
(duplicates ok)
findTheseVals(2) = DataGrid4.Item(u, 2) 'Third column and primary key
(duplicates ok)
....
Then, to delete the record from the table, I use
DataSet11.Tables("Equipment").Rows.Find(findTheseV als).Delete()
but get the following error:
An unhandled exception of type 'System.NullReferenceException' occurred in
App.exe
Additional information: Object reference not set to an instance of an object.
i.e. this record was not found, although I can physically see it in the table.
I checked the populated values of findTheseVals and it matches my primary
key values (and types) in the database table exactly.
The column orders in the dataAdapter, datagrid and database table are
identical.
I checked that the table referenced is exactly the same as the one
referenced by the datagrid etc.
When I manually delete the row from my datagrid, the record is correctly
deleted from the database.
What am I missing here?
PaulNaude Guest
-
Need code to find 2-day old files
Can this be done in PHP? I want to read a directory and for each file with a .sql extension that is older than 3 days, I want to delete it. I... -
Find and Replace Doesn't Work in Code
Hi, I used to do all my coding in Homesite which probably has the world's greatest find and replace function. I could replace hundreds of lines... -
How to find out the User Name The ASP.NET is run under in the code
Hell everyone. We have some problem with the security while trying to upload files trough the System.IO and getting the follow error: ... -
bug in code - can't find it!
Ok, after all of the discussion on posting, I'm afraid to post. Unfortunately, no one I know is a programmer, and I am a beginner. I can normally... -
[PHP] bug in code - can't find it!
Oh, yeah. Well, I just copied and pasted that from another form. Taken out, it still doesn't work. Even the echo, which is on no way related to...



Reply With Quote

