We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

problem using ExecuteScalar...

Thread ID:




38766 Dec 18,2005 08:52 AM UTC WinForms 0
Tags: FAQ
Asked On December 18, 2005 08:52 AM UTC

can any1 help me on how to retrieve zero (0) at the label text if no point (lesspoint) exists. i''ve tried many ways but this cast exception occur: Cast from type DBNull to type Integer is not valid. Pls solve my prob...Here is some code myConnect.Open() Dim comm As OleDbCommand = New OleDbCommand("Select Sum(LESSPOINT) from WAREHOUSENCR Where KPINO = 1 ", myConnect) Dim i As Integer i = comm.ExecuteScalar() lblWN1.Text = i.ToString if there is no point for KPINo 1,i want to display zero into the label text (lblWN1.Text)...Pls show me how?!!


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon