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.
Unfortunately, activation email could not send to your email. Please try again.

problem using ExecuteScalar...

Thread ID:

Created:

Platform:

Replies:

38766 Dec 18,2005 03:52 AM Windows Forms 0
loading
Tags: FAQ
ShaRa
Asked On December 18, 2005 03:52 AM

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?!!

CONFIRMATION

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.

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.

;