What is the difference between vbNullString, String.Empty and “”?

后端 未结 3 1656
予麋鹿
予麋鹿 2020-12-07 02:47

All of these

  • txtUsername.Text <> vbNullString
  • txtUsername.Text <> String.Empty
  • txtUsername.Text &
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 03:07

    If are going to insert values to MS-SQL database and if column doesn't allows null(Not null) then strValue=vbNullString will generate exception but strValue="" will insert blank spaces.

提交回复
热议问题