4 code audit queries

  • Thread starter Thread starter OSVBNET
  • Start date Start date
O

OSVBNET

Guest
Hello, just have few very quick questions, please help :)

-----------------------------------------------------------------

1. Which one is better and recommended to use?

Dim MySel As String = Convert.ToString (ComboBox.SelectedIndex + 1)
or
Dim MySel As String = (ComboBox.SelectedIndex + 1).ToString

-----------------------------------------------------------------

How to correct the following codes?

2.

Me.Tag = Me.Tag + "\"
Option Strict On prohibits operands of type Object for operator '+'

***

3.

Dim MyCounter As OleDbDataReader = CountUser.ExecuteReader
MyCounter.Read()
If MyCounter(0) = 0 Then ...
Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity.

***

4.

Private Delegate Function QuestionBoxHandler(ByVal Message As String)
Private Function ShowQuestionBox(ByVal Message As String)
Option Strict On requires all Function, Property, and Operator declarations to have an 'As' clause.

Continue reading...
 
Back
Top