Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

datagridview empty columns vb.net

$
0
0
the below code fails to retreive a row when atleast one column doesnt have a value in datagridview.can some one please tell me how to handle Nulls for each column 
        Dim Rows = _
        ( _
           From row In DataGridView1.Rows.Cast(Of DataGridViewRow)() _
           Where Not row.IsNewRow AndAlso CStr(row.Cells(cboNames.Text).Value) = cboValue.Text _
           Select ID =
           CInt(row.Cells("ID").Value),
           Name =
           CStr(row.Cells("Name").Value),
           DeviceName =
           CStr(row.Cells("DeviceName").Value),
           IPAddress =
           CStr(row.Cells("IPAddress").Value),
           WWN =
           CStr(row.Cells("WWN").Value),
           Location_ID =
           CStr(row.Cells("Location_ID").Value),
           LocationName =
           CStr(row.Cells("LocationName").Value),
           Product_Number =
           CStr(row.Cells("Product_Number ").Value),
           ILOAddress =
           CStr(row.Cells("ILOAddress ").Value),
           Make =
           CStr(row.Cells("Make").Value),
           Model =
           CStr(row.Cells("Model").Value),
           Serial_Number =
           CStr(row.Cells("Serial_Number").Value),
           Date_Added =
           CStr(row.Cells("Date_Added").Value),
           Last_Modified_Date =
           CStr(row.Cells("Last_Modified_Date").Value),
           Environment =
           CStr(row.Cells("Environment").Value),
           Support_ID =
           CStr(row.Cells("Support_ID").Value),
           SupportCompany =
           CStr(row.Cells("Company").Value)
            Order By ID).ToList

lucky


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>