Jump to content

Funcionamento do DBnull


AFrei
 Share

Recommended Posts

Boas pessoal, quero pintar uma celula de uma coluna do tipo "Date" se esta não for preenchida.

Eis o que tenho mas aparece-me o seguinte erro:

A referência de objecto não foi definida como uma instância de um objecto

Tenho que definir algo antes para o DBNull funcionar? Obg!

If DataGridView1.Item(2, row).Value.Equals(DBNull.Value) Then

                   

                    With Me.DataGridView1.Rows(row).DefaultCellStyle

                    BackColor = Color.Red

                    End With

                 

                End If

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.