Undvik konverteringsfel med nullvärden från databasen

IBland får jag felet "Input string was not in a correct format." vid funktioner enligt nedan och det finns null-värde i databasen.

<%# GetUser(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "UserId"))) %>

Då kan man göra så här för att parera nullvärdena och istället skicka in en nolla.

<%# GetUser(Eval("UserId") == DBNull.Value ? 0 : Convert.ToInt32(Eval("UserId"))) %>

Eller i Code Behind:

int userId = objDataReader["UserId"] == DBNull.Value ? 0 : Convert.ToInt32(objDataReader["UserId"]);

Comments

Really a good work it is…!!

http://www.janbaskdigitaldesign.com

nice post.it is really good work.thank you. http://www.onlinepromotionuae.ae

nice post .. and sharing a good working post............. Web Promotion Company in Delhi

very very nice article, thanks for the sharing with us.

Windows Tech Support

This is least difficult approach to stream stimulation to your TV. On your terms. With a great many accessible channels to look over for more details.

This is least difficult approach to stream stimulation to your TV. On your terms. With a great many accessible channels to look over for more details.visit: roku link code today.

Roku gives the least difficult approach to stream diversion to your TV. On your terms roku link enter activation code With a huge number of accessible channels to browse.

Initiate Roku.com/interface, go to roku activation link code account enter Roku com connect code showed on Roku TV. My roku com interface not working utilize new Roku code

This is least troublesome way to deal with stream incitement to your TV. On your terms. With a considerable number of available channels to investigate for more details.visit: activate my roku code today.

Roku gives the least troublesome way to deal with stream redirection to your TV. On your terms Activation Roku Code Link With countless channels to peruse.

Start Roku.com/interface, go to activate roku code account enter Roku com associate code appeared on Roku TV. My roku com interface not working use new Roku code

This is least troublesome approach to manage stream actuation to your TV. On your terms. Wit h an extensive number of accessible channels to research for more details.visit: roku.com/link today.

Roku gives the least troublesome approach to manage stream redirection to your TV. On your terms roku code link With innumerable channels to scrutinize.

Download office tools without putting any efforts. We are ready to give you complete help till the completion of the installation process.Step by step instructions to install office 365 in your computer. For any help office setup Call us and we are here to help you.

norton help to guarantee your devices against antiviruses and offer security to customer and giving identity and contraption confirmation to your related life. visit : norton setup for more details.

Download office instruments without putting any endeavors. We are prepared to give you complete help till the finishing of the establishment procedure Step by step guidelines to introduce in your PC. For any assistance office/setup Call us and we are here to support you.

Thanks for sharing this marvelous post. I m very pleased to read this article.

norton.com/setup office.com/setup mcafee.com/activate norton.com/setup office.com/setup mcafee.com/activate office.com/setup norton.com/setup

Collaborate for free with online versions of Microsoft Word, PowerPoint, Excel, and OneNote. Save documents, spreadsheets, and presentations online, in OneDrive.

norton.com/setup office setup office.com/setup mcafee activate norton.com/setup

Office.com/setup.com is an efficiency suite that is useful by many individuals on a large scale of contraptions, for example, Windows PCs, Mac PCs, workstations, Android telephones, iOS handhelds, and so The suite is capable of dealing with the staggering bit of work. http://office-comofficeoffice.com/

Norton.com/setupinstall online security apparatuses guarantee that the individuals who manage delicate information do as such without dread of bargaining touchy data. Keep your documents, information, and applications running easily and your hard drive clean when you buy Norton 360 download. http://norton-wwwnorton.com/

Microsoft Office.com 2019 the on the web and moreover the work region interpretation of the work environment to its customers. You can use the Office on your structure. http://officecomcomoffice.com/

Visit mcafee.com/activate and provide 25 digits alpha-numeric product key code. Download, install and activate McAfee by following a few simple steps.

Visit mcafee.com/activate and provide 25 digits alpha-numeric product key code. Download, install and activate McAfee by following a few simple steps.

Sign in to enter office setup product key. Know how to benefit, download, install, set in movement, uninstall and reinstall MS office setup. http://officecom-officeoffice.com call us at +1-888-421-9666[tool free]

Sign in to enter office setup product key. Know how to benefit, download, install, set in movement, uninstall and reinstall MS office setup.visit http://officecom-officeoffice.com and Get Started by now Office setup.

call us at +1-888-421-9666[tool free]

Roku updated its product lineup with three new boxes. However, the Ethernet connection and remote with motion control for games are available only on the XS model. The Roku Game Remote uses Hillcrest Labs' Freespace motion control technology, so users can control games with natural gestures.

With Norton Antivirus, you can discharge up as it works an as a shield to your PC. Your PC is completely guaranteed and guaranteed by the world's driving security provider. http://nortoncomnortoncom.com/"> http://nortoncomnortoncom.com/

Really I like your article it is easy to reading. You are a good blogger please keep it up. Thank you so much.

Hulu com forgot

Thank you for sharing this article such a helpful and informative article. Hope to see again this kind of article in future.

Silversingles Phone Number Silversingles Customer Care

Please fill out all the fields.

*
*