Lensulu
asked on
Dealing with null value cells in a datagridview
I have a datagridview with various columns - where one column has some data on a some rows - with most of the rows having no data ( null info).I want to read row by row skipping any row where the data is null.In VB6 I wrote if column = "" then -skip to next column. This does not work in VB8. Can anyone help please.
I have tried code like
"If Convert.ToInt32(Me.Transac tDataGridV iew.Rows(i ).Cells(1) .Value.ToS tring()) = 0 Then"
-this does not work.
I have tried code like
"If Convert.ToInt32(Me.Transac
-this does not work.
Should this be also in Visual Basic.NET ZONE ?
Ashok
Ashok
ASKER
My telesense does not pick up isdbnull. Am i missing a space import.
ASKER
My telesense does not pick up isdbnull. Am i missing a space import.I only need in vb net.
Dim ob As Object = Me.TransactDataGridView.Ro ws(1).Cell s(1)
If (Convert.IsDBNull(ob)) Then
End If
HTH
Ashok
If (Convert.IsDBNull(ob)) Then
End If
HTH
Ashok
Dim ob As Object = Me.TransactDataGridView.Ro ws(i).Cell s(1)
If (Convert.IsDBNull(ob)) Then
End If
HTH
Ashok
If (Convert.IsDBNull(ob)) Then
End If
HTH
Ashok
Could you add ZONE "Visual Basic.NET" to this question?
Ashok
Ashok
ASKER
Dim ob As Object = Me.TransactDataGridView.Ro ws(i).Cell s(1)
rbPayandDEp.Checked = True
'here code for both
counter = 0
Do While i < rowcount - 1
' If (Me.TransactDataGridView{C olumnIndex =1,Rowinde x=i} = "x" Then
' MsgBox(Me.TransactDataGrid View.Rows( i).Cells(1 ).ToString )
If (Convert.IsDBNull(ob)) Or (Me.TransactDataGridView.R ows(i).Cel ls(1).Valu e.ToString ) = " " Then
Me.TransactDataGridView.Ro ws(i).Cell s(1).Value = prefix + ((startnumber + counter).ToString)
'increment counter when found
counter = counter + 1
End If
i = i + 1
Loop
The above code does not code the blanks or null items.It just runs through without an error.
You asked me to include ZONE vbNet - how do i do that at this point. It is a Zone VB net problem.
Thansk
rbPayandDEp.Checked = True
'here code for both
counter = 0
Do While i < rowcount - 1
' If (Me.TransactDataGridView{C
' MsgBox(Me.TransactDataGrid
If (Convert.IsDBNull(ob)) Or (Me.TransactDataGridView.R
Me.TransactDataGridView.Ro
'increment counter when found
counter = counter + 1
End If
i = i + 1
Loop
The above code does not code the blanks or null items.It just runs through without an error.
You asked me to include ZONE vbNet - how do i do that at this point. It is a Zone VB net problem.
Thansk
If IsDBNull(Me.TransactDataGr idView.Row s(i).Cells (1)) Then
End If
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks - I'm learning.first steps taken.
ASKER
Finally solved problem - thanks very much
Ashkok111.
Ashkok111.
If (Me.TransactDataGridView.R
Ashok