Error - System.NullReferenceException....

firefly

New Member
Hello All,<BR><BR>I am getting the following error when adding a row to a datatable I created on the Page_Load... does anyone know why this is?<BR><BR>Error: System.NullReferenceException: Object reference not set to an instance of an object.<BR><BR>I am creating the datatable on the Page_Load, and then have a Web Form that the user enters information into it and when posted it is added to the datatable with a Button_Click subroutine... Also I only have the table being created "If Not IsPostBack Then" so that the table is not created again each time the page loads... does the table not persist or am I missing something else? Thanks guys and gals...Your object cannot be null when loading from a db. You have to do a check on it using isdbnull...<BR><BR>try something like<BR><BR>if isdbnull(dbvalue) then<BR>'do something<BR>end if
 
Back
Top