Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Cast from type 'DBNull' to type 'Integer' is not valid

$
0
0
I am working on a legacy application that was built a couple years back....and for some reason one of the pages broke. Now please keep in mind Im not a guru when it comes to ASP.NET. I have a data grid/C1webgrid that I believe is giving me troubles. The reason I say that is sometimes I can access the page and all of my grids populate except for the very last one.

Now with said, I have checked my database and from what I can tell nothing looks null. I have search online for the error message, and I think I have an understanding as to what is happening. If Im not mistaken I am referencing a value of a datacolumn that is null. Now I am going to post my Stack Trace and then ask my question.

[InvalidCastException: Cast from type 'DBNull' to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromObject(Object Value) +819
ClientPortal.Team.GetSetUpData() +280
ClientPortal.Team.Page_Load(Object sender, EventArgs e) +612
System.Web.UI.Control.onload(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


Now my question is this....is my error occurring at the GetSetUpData function. The reason I ask is because Im not the best when it comes to reading these stack traces. Also I wanted to post this and try find the answer on my own before I post any code. Thanks in advance!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>