Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15067

VS 2013 How Can I Check DataTable Image Exist Or Not ?

$
0
0
Hi Everyone.
In Program has Database for Save Images.

I am transfering this images on to a Document. If in DataTable has Image it works. but if there is no Image Code dosent Work.

Code:

    Dim img() As Byte
                img = CType(DttblIMG.Rows(0)(1), Byte())

                If img Is Nothing Then 'DttblIMG.Rows(0)(1).Value Is DBNull.Value Then
                  "CODES"

                ElseIf img IsNot Nothing Then 'If DttblIMG.Rows(0)(1).Value IsNot DBNull.Value Then
                  "CODES"

img = CType(DttblIMG.Rows(0)(1), Byte())

in this code line if there is and image in DataTable it works properly but if no image it's canceling...


Where is my mistake ?

Viewing all articles
Browse latest Browse all 15067

Trending Articles