首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

怎么判断DataGridView.CurrentRow.Cells(0)的值不为空值

2012-06-17 
如何判断DataGridView.CurrentRow.Cells(0)的值不为空值?VB codeDataGridView.CurrentRow.Cells(0).Value

如何判断DataGridView.CurrentRow.Cells(0)的值不为空值?

VB code
DataGridView.CurrentRow.Cells(0).Value <> NothingDataGridView.CurrentRow.Cells(0).Value <> DBNull.ValueDataGridView.CurrentRow.Cells(0).Value IsNot NothingDataGridView.CurrentRow.Cells(0).Value IsNot DBNull.Value'以上幾種寫法都不對,都報錯


[解决办法]
not DataGridView.CurrentRow.Cells(0).Value is Nothing
  
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 
http://feiyun0112.cnblogs.com/
[解决办法]
if IsDBNull(DataGridView.CurrentRow.Cells(0).Value)=True then

end if
[解决办法]


Not IsNothing(DataGridView.CurrentRow.Cells(0).Value) Andalso DataGridView.CurrentRow.Cells(0).Value.ToString <> "" 


[解决办法]
估计不是这里的错误了
把你的代码贴出来
[解决办法]
VB.NET code
If DataGridView.SelectedRows.Count > 0 Then    If Not IsDBNull(DataGridView.CurrentRow.Cells("WID").Value) Then        '……    End IfEnd If
[解决办法]
VB.NET code
If DataGridView <> Nothing Then    If DataGridView.CurrentRow <> Nothing Then        If DataGridView.CurrentRow.Cells <> Nothing Then            If DataGridView.CurrentRow.Cells(0) <> Nothing Then                If DataGridView.CurrentRow.Cells(0).Value <> Nothing Then 

热点排行