I'm tweaking and adjusting another programmer's ASP.NET application and this language is definitely not my forte. As a result, I'm totally lost on this error and I'm not sure how to fix it or even where to start.
In one of the pages when I attempt to save the information to the database, I get the following error:
The line that starts with "keyNum" is highlighted as the line with the error (which I know isn't necessarily true, but it's what I have to start with right now).
This page worked before I did my tweaks and edits but doesn't know. My edits involved moving all the tables from one database to another, renaming most of them, and replacing some with my versions. Then I went through the code and made the .NET code refer to the new tables, fixed some of the column names and types in the replaced tables, and migrated a Stored Procedure over that I didn't know about until the app failed at one location.
I've managed to fix all the errors except for this one. I've checked to make sure the table names, column names and column types are correct (they are). Any help would be appreciated!
In one of the pages when I attempt to save the information to the database, I get the following error:
Code:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
comm.CommandText = "SELECT " + field + " FROM Timesheet_AssignmentIDs";
keyNum = (Int32) comm.ExecuteScalar();
The line that starts with "keyNum" is highlighted as the line with the error (which I know isn't necessarily true, but it's what I have to start with right now).
This page worked before I did my tweaks and edits but doesn't know. My edits involved moving all the tables from one database to another, renaming most of them, and replacing some with my versions. Then I went through the code and made the .NET code refer to the new tables, fixed some of the column names and types in the replaced tables, and migrated a Stored Procedure over that I didn't know about until the app failed at one location.
I've managed to fix all the errors except for this one. I've checked to make sure the table names, column names and column types are correct (they are). Any help would be appreciated!