Visual Basic.NET





Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,

Share tech news, updates, or what's on your mind.

Sign up to Post

top 3 only query

Hi experts
how to achive

          SELECT top 3
    WHEN el = 'was' THEN ml
    ELSE mv
  END AS float))
FROM mlbscores
WHERE (el = 'was' OR ev = 'was') AND LEAGE = 'NHL'  order by ident desc

Starting with Angular 5
LVL 13
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

select AVG(cast(mv AS float))  from mlbscores where el='cal'  AND LEAGE='nhl'

select AVG(cast(ml AS float))  from mlbscores where ev='cal'  AND LEAGE='nhl'

Hi you experts how to merge this 2 results in just one
Trouble adding comma to bar graph data using Windows Chart Class

I am using the library:

and found I could format (with comma) for values > 1,000

with this line of code:
ca.AxisY.LabelStyle.Format = ("##,#");

But, I can't figure out how to get the data to display also with the comma.

Best I get is the following:
Missing Comma on Data
Here is the Microsoft reference document:
I am iterating through a text file using Some of the numeric values are stored as strings. I would like to use the command Convert.ToSingle to convert the string input into a decimal(Or floating point number). How shall I handle the case when the string value is not numeric, because an exception will be thrown? I wish there was a command that could in effect look ahead to determine if the value is not numeric.

Dim num As Single
num - Convert.ToString(inString) ' Exception thrown here if the inString value is not numeric
Using Microsoft .NET Framework Version 4.8.03752 I performed a [successful] FTP upload.  How do I compare the source and the target to verify they match?
I am maintaining some code that uses key value pairs. Below is a simple example. What I need to know is how to access some of the values. See the example below.
Three values are added to the collection. So how can I iterate through the collection and retrieve the values "Canada", "Switzerland","Ireland"?

Dim objCollection As New Dictionary(Of String, String())


I have a VB.NET 2015 program that has a Tcp socket Listener and client applications to send messages to workers by their ip address.
I need to be able to pick up a file from a directory and send the text files data to a client machine connected to the listener. The file name is the ip address. When the file gets put into the directory is when the listener will pickup the file and send it to the appropriate ip address. I can pickup the file but the message gets sent to all clients connected to the listener.  My code is below.

Imports System.IO
Imports System.Net
Imports System.Net.Sockets
Imports System.Drawing.Size
Imports System.Net.IPAddress
Imports Microsoft.VisualBasic.FileSystem
Imports System.Windows.Forms
Imports System.ComponentModel

Public Class Form1
    Public watchfolder As FileSystemWatcher
    Dim ServerStatus As Boolean = False
    Dim ServerTrying = False
    Dim Server As TcpListener
    Dim Clients As New List(Of TcpClient)

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        CheckForIllegalCrossThreadCalls = False

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'Dim CN_GetData2015 As New CN_GetData2015

    End Sub

    Function StartServer()
        If ServerStatus = False Then
            ServerTrying = True
                Server = New 

Open in new window

How do i pick up the default printer and print the image in the picture box.
I am using
There's a field in a table of a SQL Server database that doesn't except "NULL" but has a default value of "0".  The InsertCommand for the data adapter that automatically  generates doesn't accommodate this. If the field is left blank in the front end program, the update method of the data adapter fails with a message that the field can't be left blank.  It doesn't set it to the default value that is set in the SQL Server table.  What is the easiest way to get the data adapter to set the field to the default value when the corresponding parameter is null (from being left blank by the user)?
I have the following regular expression which is in some code I am maintaining. I know that it is used for formatting amounts of money.
Can someone interpret exactly what the regular expression represents as far as digits, decimal places etc. or whatever?


In :
Dim myMoneyRegEx As String ="^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(\.[0-9]{1,4})?$"
Build an E-Commerce Site with Angular 5
LVL 13
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

In visual studio 2019  how to set auto incrementing build number or version number.
Hello Experts,
I am getting error "Filesystem.vb not found" in several small vbnet projects that were working just fine.... we did not change the sources
and now this message.
on the internet seems to talk about other topics not this.
using vb2019
Please your advice.
When should you upload/download a file using a stream instead of a file?  So far I have found the streaming a dll or exe does not always work.
Using VB.NET  (Visual Studio 2019) in windows form how I can update the app.config file?  somebody know an example
I have an application in Ms access , now I want the code below which is in VB.Net to be converted into Ms Access VBA, kindly see how you can help.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{41E07C9B-449E-4AF4-826E-00ACA3CF6254}"
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Debug|x64 = Debug|x64
		Debug|x86 = Debug|x86
		Release|Any CPU = Release|Any CPU
		Release|x64 = Release|x64
		Release|x86 = Release|x86
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x64.ActiveCfg = Debug|x64
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x64.Build.0 = Debug|x64
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x86.ActiveCfg = Debug|x86
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x86.Build.0 = Debug|x86
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|Any CPU.Build.0 = Release|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|x64.ActiveCfg = Release|x64

Open in new window

In a datetime field how do I determine if the time is between
00:00  to 2:45

Datetime Field :  23/09/2019 00:15
The value is between 00:00  to 2:45
 and should return true

Datetime Field :  23/09/2019 01:15
The value is between 00:00  to 2:45
 and should return true

Datetime Field :  23/09/2019 02:46
The value is not between 00:00  to 2:45
 and should return false
Set datacolumn to date in
I have a Async Function that references a control on the screen.  The control is updated with new information during the running of the function.  Do I place the Await Task.Delay(1) before or after the control is updated?

Btn.text = "One" : Await Task.Delay(1)


Await Task.Delay(1) : Btn.text = "One"
I have a list of usernames/passwords that were the initial passwords given, but should have been changed. I've been told that some of the users used the same password and we want to make sure the password has been changed. We now have a password policy in place for the group, but how can I check if the password has changed? Please note that users did enter a new password, but because a password policy was not in place at the time, some entered the original password as the new password.

I have a file in the following format of username,password:

How can I test the credentials in this file against AD to see what users entered the same password?  I was thinking I would probably use either PowerShell, VBScript, C# or
HTML5 and CSS3 Fundamentals
LVL 13
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Is there a better and faster way of Application.doevents
Dear Experts;

I would like to convert the code below from VB.Net to VBA in Ms Access, any idea?

Public Class details
        Public Property ProductId As Integer
        Public Property Description As String
        Public Property SpecialCode As String
        Public Property Quantity As Integer
        Public Property UnitPrice As Integer
        Public Property Rebates As Integer
        Public Property Tax As String()
        Public Property TotalAmount As Integer
        Public Property TaxInclusive As Boolean
        Public Property FinalPrice As Integer
    End Class

    Public Class Range
        Public Property SerialNumber As String
        Public Property Date As String
        Public Property TransactionType As Integer
        Public Property PaymentMode As Integer
        Public Property Sale As Integer
        Public Property Order As String
        Public Property Clerk As String
        Public Property TaxID As String
        Public Property BuyerName As String
        Public Property AccountName As String
        Public Property Address As String
        Public Property Tel As String
        Public Property InvoiceCode As String
        Public Property InvoiceNumber As String
        Public Property Items As Item()
    End Class

Open in new window


How to query or just get few columns a existing datatable to generate a new datatable of the result set.

Given a date, how to get the date on Sunday for that week.
One line code will be great!


How can I find a count for many days remaining for a Sunday  in that week .
Date : 24/09/2019 which is Tuesday
The date on Sunday in that week  will be 29/09/2019
So the count is 5

I will be provided with the current date, need to find the remaining days count till Sunday.

Is there a way to build a solution for installing a Microsoft Access database . I want to deploy a an .exe file that when double clicked installs the Access solution

Visual Basic.NET





Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,