Hi.. and hello..
could i ask you all a question? i had a problem.
situation:
=======
the input box cannot grab the NULL value (blank).
My own solution (but not solve):
====================
i'm try make try and catch. let's see my code..
when i try to compile..i will get errorCode:Private Sub GetData() Dim row As Integer = DataGridView1.Rows.Count Dim N As Integer N = 0 N = InputBox("Enter the number of order :") Try N = DBNull.Value <----------------- here the problem (maybe) Catch ex As Exception MsgBox(ex.Message) End Try Dim jumlah As Decimal jumlah = Decimal.Round(N * txt_harga.Text).ToString("f2") Me.DataGridView1.Rows.Add(row, kodMakanMinum, txt_foodDrinkName.Text, N, jumlah) End Sub
can you show me a "hack" to use null / blank ? to read it and catch the err0r ?Code:Error:Value of type 'System.DBNull' cannot be converted to 'Integer'.




Reply With Quote