Questions tagged [vb.net-2010]

The version of Visual Basic .NET used in Visual Studio/Visual Basic 2010. Use VB.NET and Visual Studio 2010 tags instead unless the question is specifically about language features added in VB.NET 2010.

The version of Visual Basic .NET used in Visual Studio/Visual Basic 2010. New features include:

  • Less-strict line continuation; for example, this syntax is allowed:

    Dim lines() As String = {
        "I am line number one",
        "and I am line number two."
    }
    
  • Auto-implemented properties. This:

    Public Property Hello() As String = "World"
    

    is compiled like this:

    Private _hello As String = "World"
    
    Public Property Hello() As String
        Get
            Return _hello
        End Get
        Set(ByVal value As String)
            _hello = value
        End Set
    End Property
    
  • Collection initializers using From:

    Dim l As New List(Of String) From {"Hello", "World"}
    
  • Multi-line lambdas:

    Call New Thread(Sub()
                        Console.WriteLine("Hello, world!")
                    End Sub).Start()
    
  • Support for dynamic types

  • Support for contravariance and covariance

The full list of changes can be found here.

2117 questions
4
votes
0 answers

VB.net - Windows.Forms.Screen.AllScreens report wrong bound sizes when using any DPI scaling above 125%, anyway to fix this?

I have my vb.net application (written in VS2010 pro) setup to detect and support multi-monitor setups at various DPI scaling. I use Screen.AllScreens.Length to get me how many monitors I have running: Public Function getMonitorCount() As Integer …
thebunnyrules
  • 1,520
  • 15
  • 22
4
votes
1 answer

Crystal Report graph not showing properly

I have 2 graphs in one report: The top graph has 2 similar points, which each points showing itself as is, I have encircled the points in brown just to be clear. The graph below the first one has a similar point also, which I encircled in blue, but…
Mr.J
  • 430
  • 2
  • 10
  • 30
4
votes
3 answers

Thread safe variable in VB.NET

Is this the right way of declaration dbreaders when mulitple users access the same page? public dbReader as system.Data.IDataReader at class level or Dim dbReader as System.Data.IDataReader in each function inside a class. What would be the best…
sony
  • 51
  • 1
  • 3
  • 6
4
votes
1 answer

What is a good practical application example of the Dynamic Language Runtime in .NET 4.0?

I wish to better understand the real-world application of this new feature that consists the Dynamic Language Runtime (DLR). I would like: Brief explanation of how it could be used; A brief sample code that shows how to take advantage of…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
4
votes
3 answers

How to change SQL Server Instance TCP Ports to 1433 using CMD?

I'm thinking if it possible to change SQL Server 2008 Instance TCP Ports to 1433 using cmd and without using SQL Server Configuration Manager. I just want to apply this to my application setup, My client wants it to be in multi-user mode. I know…
4
votes
1 answer

Display particular part of website

I'm going to create a tool which displays webpage rank in VB.NET. For that I use Dim str As String = New WebClient().DownloadString(("http://www.alexa.com/siteinfo/" + TextBox1.Text)) And I just want the Global Rank of that url which I provided in…
Amit kumar
  • 151
  • 1
  • 4
  • 20
4
votes
1 answer

Web Browser to handle pop ups within the application

I am trying to use the WebBrowser control to launch a new form for popups instead of it opening in IE. I have tried to use the AxWebBrowser instead to get the popups which works with NewWindow3 event and just doing e.ppDisp =…
4
votes
2 answers

Can I pass a class reference as a parameter to a function in VBNet?

Please forgive me if I use improper terminology or sound like a complete noob. When calling a sub in a class library, I'd like to pass not an instantiated form, but just a reference to the class that represents the form. Then I want to instantiate…
mindofsound
  • 78
  • 1
  • 1
  • 6
4
votes
2 answers

Printing / Graphics Problems

Language: VB .NET 2010 Win Form Scope: I have developed a label printing program that is intended to print custom labels to a zebra printer. I was having problems with clarity from the printer when I tried to print the entire label as an image…
Eric F
  • 899
  • 2
  • 21
  • 45
4
votes
3 answers

How To Get The Redirected URL From Original URL Visual Basic .NET

How Can I Get The Redirected URL From Original or Short URL? for example: URL_1 (Short URL) = "http://af.ly/FQhAo" This will redirect to URL_2 (Original URL) =…
Muhammad Saqib
  • 2,185
  • 3
  • 35
  • 48
4
votes
3 answers

Filter records from the dataset in vb.net

I want to filter values from a dataset. It contain phone numbers starting with zero and non zero values. How can I filter a phone number (start with non zero no) from the dataset. Below is the vb.net code and the resulting error. cmd = New…
vps
  • 1,337
  • 7
  • 23
  • 41
4
votes
9 answers

Error inside of Application.Designer.vb inside of OnCreateMainForm() Sub

I can't figure out what the issue is here. I started project from scratch, went to debug, and received error: System.InvalidOperationException was unhandled Message=An error occurred creating the form. See Exception.InnerException for details.…
Josh McKearin
  • 742
  • 4
  • 19
  • 42
4
votes
2 answers

XML Schema Error: Required white space was missing

I have been searching on this for hours and can not figure out the issue. Could someone please help me with this? I am getting the above error when Executing a SQLXMLBULKLOAD in VB.NET 2010. I have attempted changing my xml declaration, my schema…
Josh McKearin
  • 742
  • 4
  • 19
  • 42
4
votes
2 answers

Html.RenderPartial does not produce a value

Good day, all. I know that this is a pretty basic question in terms of MVC, but I can not for the life of me get @Html.RenderPartial to not give me errors. I am using VB.NET, and Razor. Most examples that I have found online are written in c#,…
AaronBastian
  • 307
  • 3
  • 13
3
votes
1 answer

How can I determine the system requirements of my APP?

Well, I have a application which somehow requires some system resources, but how do I determine all the needs of the application? How do companies which release software and games know you need a 1.5 ghz processor? And what is the fastest way to let…
user1182183