Wednesday, August 12, 2009

No mapping exists from object type System.Web.UI.WebControls.Label to a known managed provider native type.

 

If you come across this error below  in C# ASP.Net

“No mapping exists from object type System.Web.UI.WebControls.Label to a known managed provider native type.”

Turns out the reason this error showed up was I was trying to set the session variable equal to just the name of the label. So as an example I had this:

session["variable"] = lblName;

And it needed to be:

session["variable"] = lblName.Text;

1 comment: