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

In ADUC (and VB.NET) I can use a LDAP query to return objects using GUID



And this works well for objects which exist

But can't get it to work for deleted objects





But doesn't show any result, where if I used the same GUID in powershell e.g.

 get-adobject -identity ea33990b-7356-48e4-b63a-a31a3b0b3809 -IncludeDeletedObjects

it returns:-

 Deleted           : True
 DistinguishedName : CN=LXXX64\0ADEL:ea33990b-7356-48e4-b63a-a31a3b0b3809,CN=Deleted
 Name             : LXXX64
 ObjectClass       : nTDSConnection
 ObjectGUID       : ea33990b-7356-48e4-b63a-a31a3b0b3809

Any ideas why the LDAP query is not working for deleted items but the powershell one is?

I need to convert get name of an object from its object GUID in my VB app and currently best way I know in VB.NET is using System.DirectoryServices and a LDAP query
The 14th Annual Expert Award Winners
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Can a expert explain to me about itemtype in For example I am seeing the following class declaration. I searched online, and in MSDN, but nothing meaningful came back.

Public Class Singleton(Of itemtype As {New})

Public Sub New()
can someone tell me what is wrong with this query in   im trying to use wmic to get file information
dim num as string = "001" ' used to test
querys = "Select * from cim_datafile where drive=''C:'' AND Path = ''\\usr\\comm\\upload\\to_central\\'' AND filename =''invoice.''" & num.ToString()

Open in new window

We are creating hundreds of C#.NET forms by reading the VFP source and writing the .cs code.

The height, width, top, and bottom of all objects are identical.  The font is identical (exception MS Sans Serif is changed to Microsoft Sans Serif.  Also same font size.

The spacing and size of the objects are slightly different.  Enough to make a mess when the objects(labels, textboxes) are close together.

We need them to be identical. Any suggestions?
On a build of my solution I am getting the message below
It shows as succeeded but what does the message mean?

Error occurred while restoring NuGet packages: System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetDirectoryName(String path)
   at NuGet.VisualStudio.VsUtility.GetNuGetSolutionFolder(Solution solution)
   at NuGet.VsEvents.PackageRestorer.UsingOldPackageRestore(Solution solution)
   at NuGet.VsEvents.PackageRestorer.BuildEvents_OnBuildBegin(vsBuildScope Scope, vsBuildAction Action).
------ Build started: Project: wsClientAPI-Prod, Configuration: Debug Any CPU ------
Warning: Unable to update auto-refresh reference 'restsharp.dll'. Cannot find assembly 'C:\Webs\wsClientAPI-LarryT\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll'.
Warning: Unable to update auto-refresh reference ''. Cannot find assembly 'C:\Webs\wsClientAPI-Prod\packages\\lib\net40\'.
Validating Web Site
Building directory '/'.

Validation Complete
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

Open in new window

Hi.  I'm using and Visual Studio 2008 and Windows Forms.

1 WIth the datepicker object, I've blanked out the value initially then I let the user choose a date from the popup calendar.
After a user chooses a date from the popup calendar, then their date is populated into the form's field; however, if they change their mind and want it to go back to blank, it doesn't let them do that -- How do I allow a user to choose a blank option?

2. In a different datepicker field, I want it to be readonly so I've set the property to enabled=false.  Problem is it doesn't look greyed out (it's still white) so user thinks it's a field they're supposed to enter.   How do I make a disabled datepicker field greyed out?
I have main form which has a menu(toolstrip) and after the menu i have put a panel.From this menu a user selects an option lets say forexample,customers another form is displayed with list of customers but inside the panel.Am using listview to display a list of customers.When user double clicks on one of customers another form is displayed with form fields filled with customer details ready to be edited.When user finishes editing he saves the details and records are saved without a problem.Now what i want is to refresh the list on form within the panel.I have tried "frmCustomers.pull_customers_List" but it doesn't work.What could be the solution?

NOTE:pull_customers_List is the function used to query cutomers from the DB and display on listview.

Dim frm As New frmCustomers
frm.TopLevel = False
frm.Parent = Me.Panel1
I have a process that sends email campaigns to our customers.

The send part is using multi-threading
 tasks.Add(Task.Run(Of Long)(Function() SendGridMail(myMessage, sgUsername, sgPassword, CInt(drEmail("EmailAddressID")))))

But we are getting as many as 650 open SQL Connections and that is slowing down our server dramatically

Is there a way to limit the number of threads or slow things down a bit?
How can I delete the control when I move off the mouse hover over if a label. The code is below:

  Private UserControl As UcGauges = New UcGauges
    Private Sub lblGaugeID_EditScreenDescription_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles lblGaugeID_EditScreenDescription.MouseHover
        Using tempUcGauges As Form = New Form
            tempUcGauges.Location = New Point(300, 300)
            tempUcGauges.TopMost = True
        End Using
    End Sub
 Private Sub lblGaugeID_EditScreenDescription_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles lblGaugeID_EditScreenDescription.MouseLeave

    End Sub
End Class

Open in new window

*Using Telerik controls here..

I am having problems trying to get a radAsyncUpload control to show up in a row of a radGrid when the row is selected by clicking anyplace on that row.  I am guessing I need to toggle the radGrid into Edit mode once a row is selected?  I have the radAsyncUpload control in the EditItemTemplate of the radGrid for the "Upload" column.  I would then like for the single upload be performed before any other row may be selected to upload another file.

RadPageView4 is the section in question.

<telerik:RadTabStrip RenderMode="Lightweight" ID="rdTab" runat="server" Orientation="HorizontalTop" Align="Left" MultiPageID="RadMultiPage2" SelectedIndex="0">
		<telerik:RadTab Text="Status" Selected="True" ImageUrl="~/images/RedDot.png" ></telerik:RadTab>
		<telerik:RadTab Text="Ship Group"></telerik:RadTab>
		<telerik:RadTab Text="Tube Groups"></telerik:RadTab>
		<telerik:RadTab Text="Regulatory Work"></telerik:RadTab>

<telerik:RadMultiPage ID="RadMultiPage2" runat="server" SelectedIndex="0" Width="50%">
		<telerik:RadPageView ID="RadPageView1" runat="server" Width="100%">
			Approved: <asp:Label ID="lblApproved" runat="server" Text="False"></asp:Label>
			<asp:Button ID="btnApproval" runat="server" Text="Submit Approval" Enabled="False"/>

		<telerik:RadPageView ID="RadPageView2" runat="server" Width="100%">

Open in new window

Free Tool: ZipGrep
LVL 12
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community. and SQL Server 2005:

On a master detail form I need to be able to have a DGV that that is pre - populated with a checklist that can be edited and contains checkboxes that can be checked.

Every instance of the master form will have a DGV with exclusive data

We have a VB.NET application that displays customer records from SQL 2016 database. We can edit or delete the customer records from there. About 50 users use that application. When a user has one customer record open, I do not want any other user to be able to access it. Instead a message should be displayed that another user is accessing this record.

What is the best way to do this? Does SQL have something on a locking record?
Hi I am sending an email blast and on email I am connecting each button with userid so if any user who get email click that email then  his click can be recorded. For eg Button click is like this:

previously I was using 3.5 framework and it was working fine there but now after switching to framework 4.0, instead of going to page Email.aspx
its trying to go to, FYI I am doing URL rewriting also.

   How I can fix this problem. For fixing issue I had to remove http tag so when I call page like below then its working

  Please help
I'm getting the following error message when setting the value to a DateTime Picker using VB.NET.

'Value of '4/15/0218 12:00:00 AM' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
Parameter name: Value'

The date is definitely between the MinDate and MaxDate so I am not understanding the issue.  It's not a Null so many of the items I have read don't seem to apply.

When I type the following code

dtpDateStart.Value = "4/15/2018"  <-- This works

dtpDateStart.Value - MyProto.StartDate  <-- This Fails.  Where MyProto is a Class and StartDate is a Date in the class,

I think that should be everything unless you want the Exception Text.

Thank you,

I would like to extract the value for:  b.supplier_name.
Not sure how to accomplish this...
thanks much,

                Dim queryString As String =
                        "SELECT a.SupplierID,a.Supplier,a.Col1,a.Col2,a.Col3,b.supplier_id,b.supplier_name
                        FROM ReportServer.dbo.supplier_pricing a
                        INNER JOIN P21.dbo.supplier b
                        ON a.SupplierID = b.supplier_id
                        WHERE a.SupplierID = @supplierID"

                Dim command As New SqlCommand(queryString, connection)
                command.CommandText = queryString
                command.CommandType = CommandType.Text

Open in new window

I want to add a label into my Splitter Container that is on a form and the splitter is dock full to the form. What is happening is that the label does not appear on the scplitter control panel 1.

How can I get the label to appear on splitter control panel 1?
I would like to get a list of available domains from my office 365 account and push them into a dropdown list.  Anyone know how to get this done in  Does anyone know of a good way to do this?

Thank you in advance...
I am trying to call the method

 AddHandler menuItem4.Click, AddressOf CopyEditVehMain_Click(dgv)
I get an error : addressof operand must be the name of a

I have a string for RevNo
I need a function that splits the numeric and alpha

For example  1A should be split as  1   A  ( split as Major and minor)
                       10A should be             10  A
Get your problem seen by more experts
LVL 12
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions


Currently I'm trying to imitate on how to export data from access 2000 to a fixed width text file, and so far i have successfully exports data to text file only with fixed width.
So when I try to upload the file to a third party software that we use it says invalid format.
When this error occurs i suspect it is because i don't have a start position.

I would like to ask question on how create  and format a text file with fixed width and start position in .

This is the initial tutorial i've followed:
Is there a way I can create my own API to eDrawings for solidworks? There is one out there, but it requires an AutoCAD license.

Basically a client is giving us dwg files, we use eDrawings to view and print them.

So I would rather batch print them. Hence an API in visual studio to eDrawings would be nice. From there I could do the rest.
I haven't really created API's before, so I'll take any available advice.

 Would anyone be able to set me on the right path?
       ElseIf operation = 8 Then
            TextBox1.Text = Math.Cos(fo)

Open in new window

I am sending a table by email from, with html format, how can I add the style sheet?
My Problem is:
In VB.Net, How to fix a foreign   key column that is null (see attached)Null-Column.pdf

I have this json coming from an REST api. I now want to make a representaion of it in my site (I use for the moment). But I don't fully get it to work when I create the classes representing the json and deserialize it. This is how the json looks like when I copy it form Postman:
    "data": {
        "type": "vehicle",
        "attributes": {
            "regno": "HCA015",
            "vin": "WF0MXXGBWMDP17671"
        "links": [
                "rel": "self",
                "uri": "vehicle/vin/WF0MXXGBWMDP17671"
                "rel": "biluppgifter",
                "uri": ""
        "basic": {
            "data": {
                "make": "Ford",
                "model": "GALAXY 2.0 TDCi",
                "status": 2,
                "color": "Svart",
                "type": "PB",
                "vehicle_year": 2013,
                "model_year": 2013
        "inspection": {
            "data": {
                "latest_inspection": "2016-09-19T00:00:00+02:00",
                "inspection_valid_until": "2018-09-30T00:00:00+02:00",
                "meter": 38650,
                "next_inspection_range": [
        "status": {
            "data": {

Open in new window


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,