Questions tagged [vb.net]

Visual Basic.NET (VB.NET) is a multi-paradigm, managed, type-safe, object-oriented computer programming language. Along with C# and F#, it is one of the main languages targeting the .NET Framework. VB.NET can be viewed as an evolution of Microsoft's Visual Basic 6 (VB6) but implemented on the Microsoft .NET Framework. DO NOT USE this tag for VB6, VBA or VBScript questions.

Microsoft's Visual Basic .NET (VB.NET) is a multi-paradigm, managed, type-safe, object-oriented computer programming language. Along with C# and F#, it is one of the main languages targeting the .NET Framework. VB.NET can be viewed as an evolution of Microsoft's Visual Basic 6, but implemented on the Microsoft .NET Framework. This is reflected in VB.NET's version numbering, which continues from VB6. Although Microsoft decided to drop the ".NET" portion of the language's name in 2005, it is still often referred to that way in order to distinguish it from its predecessors.

This tag should only be used for questions that relate to .NET versions of VB. It should not be confused with , , or . Although those languages share a similar syntax with VB.NET, they are entirely different technologies.

To date, the following versions of VB.NET have been released:

VB.NET is supported on a wide range of platforms:

Popular VB.NET questions on Stack Overflow

Resources

139808 questions
112
votes
3 answers

Equivalent VB keyword for 'break'

I just moved over to the Visual Basic team here at work. What is the equivalent keyword to break in Visual Basic, that is, to exit a loop early but not the method?
Tyronomo
  • 2,047
  • 2
  • 15
  • 22
111
votes
3 answers

What is an .axd file?

What kind of purpose do .axd files serve? I know that it is used in the ASP.Net AJAX Toolkit and its controls. I'd like to know more about it. I tried Googling for it, but could not find getting basic information.
sikender
  • 5,883
  • 7
  • 42
  • 80
111
votes
3 answers

What's the difference between Console.WriteLine() vs Debug.WriteLine()?

What's the difference between Console.WriteLine() vs Debug.WriteLine()?
Zolomon
  • 9,359
  • 10
  • 36
  • 49
111
votes
20 answers

How to solve COM Exception Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))?

When I try to create a instance of a COM class it throws an exception as Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) Please suggest how could i solve it?
Jaswant Agarwal
  • 4,755
  • 9
  • 39
  • 49
110
votes
5 answers

How do I find a specific table in my EDMX model quickly?

I was wondering if anyone knows a quicker way to find a table in the EDMX model than just scrolling through the diagram and looking for the thing. Our database has around 50 tables in it and when I'm looking for a specific one it's just a chore to…
monkeymindllc
  • 1,411
  • 2
  • 9
  • 12
110
votes
8 answers

Or versus OrElse

What's the difference between or and OrElse? if temp is dbnull.value or temp = 0 produces the error: Operator '=' is not defined for type 'DBNull' and type 'Integer'. while this one works like a charm!? if temp is dbnull.value OrElse temp = 0
OrElse
  • 9,709
  • 39
  • 140
  • 253
109
votes
15 answers

Download Excel file via AJAX MVC

I have a large(ish) form in MVC. I need to be able to generate an excel file containing data from a subset of that form. The tricky bit is that this shouldn't affect the rest of the form and so I want to do it via AJAX. I've come across a few…
Valuk
  • 1,606
  • 3
  • 17
  • 23
108
votes
7 answers

Is there a VB.NET equivalent of C# out parameters?

Does VB.NET have a direct equivalent to C# out function parameters, where the variable passed into a function does not need to be initialised?
cspolton
  • 4,495
  • 4
  • 26
  • 34
108
votes
11 answers

Import CSV file to strongly typed data structure in .Net

What's the best way to import a CSV file into a strongly-typed data structure?
MattH
  • 1,975
  • 6
  • 24
  • 31
107
votes
2 answers

How Convert VB Project to C# Project

I have a project written in VB, and I need to convert the whole project to C# project. I don't want to do it file by file, I found some online converters, but they convert only lines of code, not the whole project. I found on researches, and here…
Romo Daneghyan
  • 2,099
  • 3
  • 18
  • 23
107
votes
11 answers

Event Signature in .NET -- Using a Strong Typed 'Sender'?

I fully realize that what I am proposing does not follow the .NET guidelines, and, therefore, is probably a poor idea for this reason alone. However, I would like to consider this from two possible perspectives: (1) Should I consider using this for…
Mike Rosenblum
  • 12,027
  • 6
  • 48
  • 64
104
votes
6 answers

VB.NET - How to move to next item a For Each Loop?

Is there a statment like Exit For, except instead of exiting the loop it just moves to the next item. For example: For Each I As Item In Items If I = x Then ' Move to next item End If ' Do something Next I know could simply…
Sean Taylor
  • 4,948
  • 8
  • 25
  • 27
102
votes
9 answers

Performance difference between IIf() and If

In Visual Basic, is there a performance difference when using the IIf function instead of the If statement?
Bryan Roth
  • 10,479
  • 15
  • 47
  • 56
101
votes
6 answers

How do I create a parameterized SQL query? Why Should I?

I've heard that "everyone" is using parameterized SQL queries to protect against SQL injection attacks without having to vailidate every piece of user input. How do you do this? Do you get this automatically when using stored procedures? So my…
Jim Counts
  • 12,535
  • 9
  • 45
  • 63
101
votes
10 answers

The transaction manager has disabled its support for remote/network transactions

I'm using SQL Server and ASP.NET. I have the following function: Using js = daoFactory.CreateJoinScope() Using tran = New Transactions.TransactionScope() '... tran.Complete() End Using End Using However, the following…
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175