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

Convert mm/dd/yyyy to yyyymmdd (VB.NET)

Is there any way I can convert a date of format: dd/mm/yyyy to yyyymmdd format? For example from : 25/07/2011 to 20110725? in VB.NET?
l3_08
  • 191
  • 1
  • 4
  • 13
9
votes
1 answer

Print custom and current page?

I am following this Edraw Link. I was able to search for one of my problem using this LINK. My code now is With AxEDOffice1 .PrintOut(EDOfficeLib.WdPrintOutRange.wdPrintRangeOfPages, 1, 1, "", 2) // from page , to page , (Page as…
KiRa
  • 924
  • 3
  • 17
  • 42
9
votes
1 answer

Cannot load application.Designer.vb what to do?

I got this error: Error 1 Unable to open module file 'D:\business\shared\Dropbox\badgers\vb\vb.net\My Project\Application.Designer.vb': The system cannot find the path specified. D:\business\shared\Dropbox\badgers\vb\vb.net\My…
user4951
  • 32,206
  • 53
  • 172
  • 282
9
votes
3 answers

How to zoom in a Picturebox with scrollwheel in vb.net

I'm using a set of graphics overlays to draw an image inside a picturebox control using the graphics object. I have placed the Picturebox inside a Panel and set the Panel to autoscroll. What I need to know how to do now is use the Mouse scroll wheel…
Greg Willard
  • 159
  • 1
  • 1
  • 8
9
votes
2 answers

Replace enter with space

How can i replace "Enter" in one of fields in the database with space actually I have tried the below codes in vb.net, but non of them is working for me ,, address = Replace(address, System.Environment.NewLine, " ") or address =…
Ali
  • 664
  • 3
  • 13
  • 21
9
votes
2 answers

Decrease space between controls in FlowLayoutPanel

How can I decrease the space between the controls even further? I've set all the margins and padding to 0 but there is still space between my controlers. this is the space I am getting with all margins and padding set to 0. I even set the margin…
Ervin
  • 706
  • 5
  • 21
8
votes
1 answer

How to change gridview font?

How can I change the Gridview font in an Windows Form?
niloofar
  • 91
  • 1
  • 1
  • 5
8
votes
2 answers

Displaying image from folder/file in vb.net

Dim ImagePath As String = "images/spaceship2.png" Dim img1 As Bitmap Dim newImage As Image = Image.FromFile("images/spaceship2.png") img1 = New Bitmap(ImagePath) pb2.ImageLocation = ImagePath pb1.Image = newImage I want to display image from…
8
votes
1 answer

Filling a DataGridView from SQLReader

Im a little stuck on some code that im writing An outline is that i am reading some data in from an SQL database and wantint to display it in a DataGridView on a form. I have confirmed that there is data being returned from the database but am…
PowerMan2015
  • 1,307
  • 5
  • 19
  • 40
8
votes
1 answer

Datatable select with multiple conditions SQL Query issue

From This question, its answer is almost my answer. But I am facing some sql query issue, I have the following statement in VB Dim results As DataRow() = table.Select("A = 'foo' AND B = 'bar' AND C = 'baz'") I want to place foo, bar and baz in…
AbdulAziz
  • 5,868
  • 14
  • 56
  • 77
8
votes
2 answers

Passing session data between ASP.NET web applications

I'm trying to help a friend - they have a pretty big web application (ASP.NET 4.0, Visual Basic) that has a number of subfolders that all act as quasi sub-applications (but they're just subfolders of the main application). This application will be…
xxbbcc
  • 16,930
  • 5
  • 50
  • 83
7
votes
3 answers

Why Does Replace Return Nothing on Empty String

Replace("",vbLf, "") Go figure. It should return "" No. It returns nothing. Just put the code in vb.net I think it should return "". Replace all occurance of vbLF with "". Because the original string is "" then it simply replace nothing and we got…
user4951
  • 32,206
  • 53
  • 172
  • 282
7
votes
5 answers

How to use temp table in Stored Procedure with LINQ to SQL

I use a temp table in a Stored Procedure with LINQ to SQL. I add the stored procedure to Linq to SQL dbml file then project occur error message "Unknown Return Type - The return types for the following stored procedures could not be detected.” When…
BlueZodiac
  • 97
  • 3
  • 7
7
votes
3 answers

VB.Net Linq to Entities Null Comparison - 'Is Nothing' or '= Nothing'?

We have several projects in VB.Net, using .Net Framework 4 and Linq to Entities for many of our SQL queries. Moving to EF is a new shift for us (been using it for about 4-6 months) and has the backing of upper management because we can code so much…
user1359018
6
votes
4 answers

VB.NET How to add a child node to a specific node in treeview

How to add a child node to a specific node in treeview? Say I have "Item1" in treeview already, how do I add "SubItem1" to "Item1" as it's child node? I know its probably really simple, but i tried lots of stuff, i just cant get it working.
NetInfo
  • 587
  • 2
  • 6
  • 19