tags:

views:

191

answers:

5

i know in java and other nice languages it's possible to comment out a bunch of lines at the same time. is it possible to do this in vb.net?

+1  A: 

No it is not you need to comment out each line individually

RHicke
+10  A: 

If you mean syntactically, like /* ... */ in C++, then no. But if you mean from your IDE, then from Visual Studio:

  • Highlight the text you want to comment out
  • Type Ctrl+K, then Ctrl+C
  • You can also uncomment text using Ctrl+K, then Ctrl+U
Dan Tao
+4  A: 

Yup. Select the text and then press Ctrl-K, Ctrl-C. And you can uncomment it using Ctrl-K, Ctrl-U.

Corin
A: 

If you edit VB in emacs, you just do M-x comment-region.

Cheeso
+1  A: 

You can use conditional compilation to achieve the same effect:


#If False Then

Dim parameters() As SqlParameter = _
{ _
    New SqlParameter("@program_year", programYear), _
    New SqlParameter("@report_id", reportId), _
    New SqlParameter("@report_group", reportGroup), _
    New SqlParameter("@report_period", reportPeriod) _
}
Return SqlHelper.ExecuteDataSet(Report.ConnectionString, kSql, parameters, CommandType.StoredProcedure)

#End If
Dewayne Christensen