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
12
votes
4 answers

.NET XML Deserialization ignore namespaces

I got thousands of XML files following all the same schema/structure. I implemented IXmlSerializable and thus am reading the elements and attributes myself. My problem is that these files each use a different phony namespace. These files come from…
user1698428
  • 121
  • 1
  • 3
12
votes
2 answers

Using Automapper to return IQueryable

I am trying to return an IQueryable object in one of my functions and using mapping (Automapper). It manage to return an IEnumerable object fine but as soon as i try to return an IQueryable object it throws me an error: This is the error: Missing…
Baahubali
  • 4,604
  • 6
  • 33
  • 72
12
votes
5 answers

Why does the setter of a VB.NET property require a typed argument and why is it ByVal?

In C#, a property's setter value keyword will automatically be same as the property's type. For example, in C# ,type of value is string private string str = string.Empty; public string MyText { get { return str; } set { str = value; } } If…
Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208
12
votes
4 answers

Option Strict On disallows late binding

Can someone help me fix this error? Option Strict On disallows late binding Here's the code that's causing the error: Dim SF6StdData As BindingSource = New BindingSource() ' ... If StrComp(SF6StdData.Current("O2AreaCts").ToString, "") = 0 Then …
mike
  • 201
  • 1
  • 5
  • 13
12
votes
2 answers

If StringBuilder is mutable, then why do StringBuilder methods return a StringBuilder object?

We all know that strings are immutable and StringBuilder is mutable. Right. Then why does its methods returns a StringBuilder object. Should they all not be void methods? Why this public StringBuilder Append(bool value) and not public void…
Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208
12
votes
2 answers

What is the effect of "Suppress JIT optimization on module load" debugging option?

What is the effect of the "Suppress JIT optimization on module load" debugging option? I have recently had to turn it off to deal to be able to successfully debug an app that uses a COM component. What do I risk by turning it off?
Paul Lassiter
  • 2,641
  • 5
  • 22
  • 25
12
votes
5 answers

Best way to tell if in production or development environment in .NET

I would like to send email differently on production then the development environment, such as sending emails only to me while testing. I know that I can set an application value in the webconfig file or check the url before sending the emails. I…
12
votes
2 answers

How to split a string using a multiple character separator and maintain separator

Using VB.NET - I have a string: "##RES00012##Some value ##RES00034##Another value" That I want to split using the "##RES" as a separator to: "##RES00012## Some value" and "##RES00034## Another value" The string.split function doesn't seem to offer…
Tanner
  • 22,205
  • 9
  • 65
  • 83
12
votes
3 answers

DefaultMemberAttribute - what does it do?

I've already read the MSDN article about it. It seems internally it is the way c# sets which is the function that is going to work as indexer(am I right?). Now, I've seen the following example: [DefaultMemberAttribute("Main")] public class Program…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
12
votes
2 answers

How to use parameters "@" in an SQL command in VB

I have this code to update my SQL database from data in a textbox, in VB. I need to use parameters in case the text contains a tic mark ,', or a quote ,", etc. Here is what I have: dbConn = New SqlConnection("server=.\SQLEXPRESS;Integrated…
TitanicSwimmer
  • 301
  • 2
  • 4
  • 14
12
votes
3 answers

substring and return the value after a specific character

"Testing.BSMain, Text: Start Page" I would like to substring the value above and returning me only the value after the ": " in vb.net. How can i do that?
Fire Hand
  • 25,366
  • 22
  • 53
  • 76
12
votes
2 answers

How do I query column names that contain square brackets?

I have a csv that I need to parse into a gridview in vb.net. If I do SELECT *, I get the data without issue. However, I am in a situation where I need to reference the actual column names. And problem is, I have no control over the app that…
mrwienerdog
  • 815
  • 3
  • 18
  • 35
12
votes
12 answers

Valid filename check. What is the best way?

See subject of positing for question. 1) I recall seeing a really cool option in VB.NET using LINQ to match using "LIKE%' 2) I know regular expressions will work and I suspect that will result in the shortest code and probably won't be too hard to…
Chad
  • 23,658
  • 51
  • 191
  • 321
11
votes
1 answer

Rename Visual Studio Solution Configurations?

I have a VB project which I'm trying to configure with three build configurations. I've successfully created the build configurations, but I decided the names I was using weren't descriptive enough so I went to Configuration Manager -> ->…
Frosty840
  • 7,965
  • 12
  • 50
  • 86
11
votes
3 answers

add a list into another list in vb.net

I have a list as follows and I want to add it in another list: Dim listRecord As New List(Of String) listRecord.Add(txtRating.Text) listRecord.Add(txtAge.Text) listRace.Add(listRecord) to obtain something like {{r1,a1},{r2,a2},{r3,a3}}, how can I…
Naad Dyr
  • 137
  • 3
  • 4
  • 11
1 2 3
99
100