problem using ExecuteScalar...

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

Loader.
Up arrow icon