Tag: vb.net

51 votes
10 answers
876 views
Case insensitive string compare in LINQ-to-SQL

I've read that it's unwise to use ToUpper and ToLower to perform case-insensitive string comparisons

avatar
Royal
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
817 views
The name does not exist in the namespace error in XAML

Using VS2012 working on a VB.NET WPF application. I have a simple MusicPlayer tutorial app I am using to lea

avatar
Thurman
0 1 0 9
asked 07 September, 2021
50 votes
5 answers
655 views
#if Not Debug in c#?

I have the line in vb code: #if Not Debug which I must convert, and I don't see it in c#? Is there

avatar
Margo
0 1 0 9
asked 07 September, 2021
56 votes
10 answers
1.5K views
Auto column width in EPPlus

How to make columns to be auto width when texts in columns are long? I use this code Worksheet.Column(colI

avatar
Eddie
0 1 0 9
asked 07 September, 2021
55 votes
12 answers
520 views
How to have comments in IntelliSense for function in Visual Studio?

In Visual Studio and C#, when using a built in function such as ToString(), IntelliSense shows a yellow box ex

avatar
Corrin
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
2.2K views
Multiline strings in VB.NET

Is there a way to have multiline strings in VB.NET like Python a = """ multi line string """ or PHP? $a =

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
64 votes
4 answers
2.1K views
Why C# fails to compare two object types with each other but VB doesn't?

I have two objects in C# and don't know if it's Boolean or any other type. However when I try to com

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
66 votes
7 answers
1.7K views
How should I cast in VB.NET?

Are all of these equal? Under what circumstances should I choose each over the others? var.ToString() CStr(v

avatar
Majorie
0 1 0 9
asked 07 September, 2021
59 votes
17 answers
2K views
Mixing C# & VB In The Same Project

Can you mix vb and c# files in the same project for a class library? Is there some setting that makes it possi

avatar
Tuan
0 1 0 9
asked 07 September, 2021
59 votes
8 answers
2.5K views
Classes vs. Modules in VB.NET

Is it considered an acceptable practice to use Modules instead of Classes with Shared member functions in VB.N

avatar
Arline
0 1 0 9
asked 07 September, 2021
54 votes
12 answers
1.4K views
Is String.Format as efficient as StringBuilder

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new StringBuilder(); string cat = "ca

avatar
Shanita
0 1 0 9
asked 07 September, 2021
54 votes
6 answers
1.8K views
Linq to Sql: Multiple left outer joins

I'm having some trouble figuring out how to use more than one left outer join using LINQ to SQL. I under

avatar
Frederick
0 1 0 9
asked 07 September, 2021
54 votes
13 answers
2.8K views
.NET Configuration (app.config/web.config/settings.settings)

I have a .NET application which has different configuration files for Debug and Release builds. E.g. the debug

avatar
Fabian
0 1 0 9
asked 07 September, 2021
61 votes
11 answers
2K views
What is the C# version of VB.net's InputDialog?

What is the C# version of VB.net's InputBox?

avatar
Omar
0 1 0 9
asked 07 September, 2021
57 votes
5 answers
2.4K views
How to write Unicode characters to the console?

I was wondering if it was possible, in a console application, to write characters like ℃ using .NET. When I

avatar
Basil
0 1 0 9
asked 07 September, 2021
54 votes
7 answers
3.1K views
How to loop through all the properties of a class?

I have a class. Public Class Foo Private _Name As String Public Property Name() As String Get

avatar
Winford
0 1 0 9
asked 07 September, 2021
63 votes
12 answers
3K views
ObservableCollection Doesn't support AddRange method, so I get notified for each item added, besides what about INotifyCollectionChanging?

I want to be able to add a range and get updated for the entire bulk. I also want to be able to cancel the ac

avatar
Charis
0 1 0 9
asked 07 September, 2021
58 votes
7 answers
1.6K views
What exceptions should be thrown for invalid or unexpected parameters in .NET?

What types of exceptions should be thrown for invalid or unexpected parameters in .NET? When would I choose on

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
56 votes
12 answers
786 views
Check if a string contains an element from a list (of strings)

For the following block of code: For I = 0 To listOfStrings.Count - 1 If myString.Contains(lstOfStrings.I

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
60 votes
18 answers
834 views
"Items collection must be empty before using ItemsSource."

I'm trying to get images to display in a WPF ListView styled like a WrapPanel as described in this old AT

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021