Visual Basic.NET

92K

Solutions

34

Articles & Videos

24K

Contributors

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

I have a DataList that has a bunch of controls in it. I load controls based on what is supposed to be shown from my database. I show certain images, buttons, labels based on values, and blablabla....Everything works fine. But......I have buttons that will show up based on logic and they all work but I added the RoundedCorners Extender and I noticed that the rounded corners only happen on the very first DataList item? It shows the first item with rounded corners but not on any of the following buttons? I should note that I only have code for the ItemTemplate( also have minimal code for HeaderTemplate and FooterTemplate) but not for anything else (AlternatingItemTemplate, SelectedItemTemplate, etc...). Im not sure if I have to have code for one of the other Templates in the Datalist for the roundedcorners to work for every item but I tried the AlternatingItemTemplate(?) but that didnt work.
I forgot to add that I am having the same exact problem with the balloonPopupExtender. It works on the first but not on any of the other items in the DataList

If anyone has any suggestions Id really appreciate it. If I cant find something Im just gonna take it out but I really like the look so I would hate to have to do that. Thanks for any help!!

I added a pic just to show what Im dealing with...Thx again

DataList RoundedCorners
0
Creating Instructional Tutorials  
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Hello,
How can I navigate between tabpages by arrow keys;  (Left and Right).
I am using vb.net 2015 desktop.

Cheers
0
Hi Experts,

I want to create a global variable and use it throughout the program.  I am using  "Public Action As String". But it does not work.
What should I do?

Thanks in advance.
0
Hello Experts.

I've made some good progress with learning how to interact with an Access database through VB.NET. The attached project includes some useful techniques for populating ComboBoxes with multiple columns using LINQ queries, and leverages Access' ability to generate Queries (which VS calls 'Views') for the purpose of connecting two related tables for populating the ComboBox list items, and any data bound form objects and DataGridViews.

This project uses two tables; one for a list of Players (which I call 'Roster') and one for a list of Teams. The Roster table has a Teams Key that joins to the Teams table which includes the Team Name attribute. I also decided that I wanted to include a picture of every player so Team Captains would have an easier time identifying who's who ("which of you guys is John Doe?"). So it was easy enough to add a new column to the Roster table in Access of type OLE/Object. I then added the code so the image file could be retrieved and attached to the bound PictureBox. That all works good, but since the PictureBox is only a tiny 120x90, I want to be sure the image file is sized correctly so it doesn't bloat the Access table too much.

To that end, I found a nice solution but it was in C#, so I'm not sure if I was able to convert it properly to Visual Basic. But the real head scratcher for me is understanding the concept of an IO.Stream which is how this image resizing solution is rigged. That leads to my real question -- how do I
0
EgEgI have checkbox that when' Checked' sets the  value of the checkbox into a textarea.

    Protected Sub chkReviewdate_CheckedChanged(sender As Object, e As EventArgs) Handles chkReviewdate.CheckedChanged
        CheckActions()
        txtNotes.Text = "Review date to be added or incorrect"
    End Sub

Open in new window


The problem is that when more than 1 checkbox is checked it overwrites the value in   txtNotes.Text with the latest checkbox value

What I would like to do is list ALL the values of the 'Checked' checkboxes, not just the last one. Whats the best way to achieve this?
0
Hi,

I am looking at a few different things. I am using ASP.NET 4.0 and VB.NET code-behind.

The main situation is this.

I have a page with an iFrame.  We'll call that Page 1 and the page in the iFrame as Page 2. The page of the iFrame on Page 2 is a URL location is external and that page cannot change.

Page 1 is polling the database running on reload of the page which invokes the Page_Load on the reload. That Page_Load is executing the stored procedure to check certain values in a table. Page 2 (the one in the iFrame) is where certain information is entered and will have a submit button. After a period of time, information from the Page 2 will go into the same table that I am polling on Page 1.

What is going on is every time Page1 reloads (based on like 10 second interval) the data in Page 2 (in the IFrame) is lost.

How can I keep that from happening?

I can think of one way, off the cuff, and that is to use the Page 1 and Page 2 as a frameset. And one Frame (for the Page 1) is doing the polling and reloading... The other frame is doing the Page 2 but in an iFrame.

When the user hits the "Submit" button on the second frameset (Page 2) then break out of the frameset and only have the Page 1.

Break out of the Frameset from the code behind of Page2 with JavaScript like? Or is there another way?

Page.RegisterClientScriptBlock("ResetPage", "<SCRIPT>top.location.href=" + Page1URL + "</SCRIPT>");

Open in new window


That is one option. Is there another …
0
Hi Experts,

I am testing my project in multiple computers and found a serious problem.

In Machine 1
I log in as an Admin. Then In the page I have to select Customer, location and Room. Then I click OK to go to a different page. (Sesson Admin='Y')

Then in Machine 2, I log in as a user.  select Customer, location and Room. Then I click OK to go to a different page (Sesson Admin='N')

When I come back machine 1 , where I logged in as Admin='Y' before, it changes it to Admin='N'  and all the selection (Customer, location and Room) has changed to that of machine 2.

What should I do. Please help.

Thanks in advance.
0
hi all
i want a line per ittem, please help

ObjSendMail.HTMLBody = "Nombre:" +" " + Request.Form("fname") & Chr(10) & "Email:" +" " + Request.Form("email") & Chr(10) & "Consultorio:" +" " + Request.Form("consultorio") & Chr(10) & "Comentarios:" +" " + Request.Form("message")

Open in new window


tsm
0
Hi,

I have a form form1 with a datagrid. But i call a second form form2 to made a query, to return only some records. I need to return a datatable to form1 and automatically fill a datagrid.
What is the best way to return a datatable from form2 to form1.

best regards
0
Is there a way to use WMI CONNECTION Crendentials once in a class I don't understand to code in clases just code in Form1. And also Am I closing the WMI Connection properly m = Nothing below is Source Code. I'm getting the message Get rid of IDE0017 VB.NET Object initialization can be simplified I'm creating a WMI Inventory app. Anyway any source code that is better then my Code I would appreciate cause I'm not a Professional Coder by any means but it is fun.
 Public Sub ListDrives()

        Dim options As ConnectionOptions
        options = New ConnectionOptions
        options.Username = "XXXXXX"
        options.Password = "XXXXXXXXXX"
        lvProcesses.Clear()
        '* Test the connection


        '  Dim ps() As Services
        lvProcesses.BeginUpdate()


        lvProcesses.Columns.Add("", 100, HorizontalAlignment.Left)
        lvProcesses.Columns.Add("Drive Letter", 120, HorizontalAlignment.Left)
        lvProcesses.Columns.Add("Drive Size", 120, HorizontalAlignment.Left)
        lvProcesses.Columns.Add("DriveFreespace", 120, HorizontalAlignment.Left)
        lvProcesses.Columns.Add("FileSystem", 120, HorizontalAlignment.Left)
        lvProcesses.Columns.Add("UNC Path", 200, HorizontalAlignment.Left)
        On Error Resume Next
        Dim scope As ManagementScope
        scope = New ManagementScope("\\" & ComputerName & "\root\cimv2", options)
        scope.Connect()

        Dim query As ObjectQuery
        query = New ObjectQuery("SELECT * FROM 

Open in new window

0
PeopleSoft Has Never Been Easier
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Hello,
I am using vb.net desktop.
How to have excel like filtering in datagridview.

Thaks
0
Hey I am really struggling with this one. I can use a comma delimited file with no problem in my vb.net application I am building. But when I try to use a tab delimited file all I get is one column. The comma delimited worked. The rest did not. Can anyone tell me what I am doing wrong????

Dim Delimiter As String = ""
        If Me.cbDelimiter.Text = "," Then
            CSVConn.ConnectionString = ("Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + Path.GetDirectoryName(FileName) + "; Extended Properties = ""Text;HDR=YES;FMT=Delimited""")
        End If
        If Me.cbDelimiter.Text = "|" Then
            CSVConn.ConnectionString = ("Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + Path.GetDirectoryName(FileName) + "; Extended Properties=""text;HDR=YES;FMT=Delimited(|OrdersTAB.txtOrdersTAB.txt)""")
            ' Delimiter = "FMT=Delimited(|)"
        End If
        If Me.cbDelimiter.Text = "Tab" Then
            '= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDir;Extended Properties='text;HDR=YES;FMT=CSVDelimited;'; "
            'CSVConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path.GetDirectoryName(FileName) + ";Extended Properties='text;HDR=YES;FMT=Delimited;'; "
            'CSVConn.ConnectionString = ("Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + Path.GetDirectoryName(FileName) + "; Extended Properties=""text;HDR=YES;FMT=TabDelimited""")
            '  Delimiter = "FMT=TabDelimited"
           …
0
Hello,
I am trying to merge word document  from vb.net
Please find the code :
                            oDoc.Content.Find.Execute(FindText:=StrRoomRouting,
                                                        ReplaceWith:=StrRoomRouting & " #" & StrRoomNo, Replace:=Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll, MatchCase:=True)

Open in new window


I get an COM error:

String parameter too long
StrRoomRouting & " #" & StrRoomNo, this is  a long string more than 255

Thanks
0
I have a problem serialializing xml

I do not get all 3 values of 'liggingen' back in the object. I only get the first value. I tried to make a list, but no success.
What is the error in the user defined object?

This is part of the user defined object
Public Class MatenEnLigging
        Public Liggingen As Liggingen
        Public Inhoud As Integer
        Public Oppervlakte As Integer
End Class

Public Class Liggingen
        Public Ligging As String
End Class

And this is part of the XML
<MatenEnLigging>
	<Liggingen>
        	<Ligging>aan bosrand</Ligging>
            	<Ligging>aan rustige weg</Ligging>
	        <Ligging>beschutte ligging</Ligging>
         </Liggingen>
	 <Inhoud>519</Inhoud>
	<Oppervlakte>150</Inhoud>
</MatenEnLigging>

Open in new window

0
Hi,

How can I set a variable in JavaScript on an ASPX page but also have the contents available in the VB.NET code behind? This is for an ASP.NET 4 and VB.NET

I can set the variable in the JavaScript but it's not available in the code behind.

I can set it something like this:

 function SetUserName() {
            var myvar = document.getElementById('<%= TextBox1.ClientID %>').value
            '<%Session("LastName") = "' + myvar + '" %>';
            alert('<%=Session("LastName") %>');
        }

Open in new window


But when I try to get it from the code behind using like an Intermediate window I get like:

Session("LastName")  I like "' + myvar + '"

The alert is above in the javascript is showing the right thing. But that setting it apparently only happening on the ClientSide. How do/can I get it to happen on the client side but also on the server side or can I? Is this where Ajax come into play?

If so, how would something like that be done?

Any information would be greatly appreciated.
0
Hi,

How do I modify the code below to convert dates to Day-Month-Year (i.e. 06 Dec 2016). I need to month to be in letters not numeric as the code below converts to.

result = DateTime.Parse(xnode.InnerText).ToUniversalTime().Date.ToString("dd/M/yyyy")

Thanks,

Victor
0
Hi Experts,

I have a date picker control.  I have three categories of dates.

1. Menu Available - If menu available for that date then change its color. Which I can do right now.

2. Customer Order available - If Customer order available then change its color to a different color(This web method has a CustID parameter).

3. If the date is a holiday, then disable it.

Thanks in advance.
0
I have a VB.NET application that connects with a SQL Server DB, and inserts a new record of data into a table that is an auto-increment ID column.  When the user enters the data, and decides that they do not want to save the information, the application is supposed to rollback the data and not insert it into the DB.  However, if the user does not save the data for ID number 150, for example, the code works as it should and removes the information from the DB, however upon the next entry of data into the DB, the ID number is now 151, and not 150 as that should be the next number in the sequence, since it was not utilized.

Can someone tell me code wise, how to ensure that SQL Server does not increment to the next number if the user does not save the record into the DB?  Below is the VB code that I am using for this functionality:


Private Sub frmWizard_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        If Not hasProfileBeenSaved Then
            If MsgBox("Save changes to the new profile?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
                e.Cancel = True  
            Else
                'delete profile
                DbUtil.Provider.DeleteRecord(profile.ID)
            End If
        End If
    End Sub

Open in new window



Thanks in advance for your feedback.

Regards,
aj85
0
The user provides my vb.net code with a SQL query that would look like this  for example:

select DISTINCT *from employees a INNER JOIN orders b on b.[Employee ID] = a.ID

I want to find a way to populate the datatable I create in code with the query columns and information but not actually get data. Is there a way to do this? The code also accepts queries from MySQL, MS Access, CSV as well as SQL.
0
SharePoint Admin?
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Vehicle (parent class)
Two Properties
Two functionalities or methods
One Event

two Child Classes like Two wheeler and four wheeler
One Property
One Property of vehicle Class
One functionality or method
One functionality or method from vehicle
0
Hi Experts,

I have a textbox which accepts a date  for example "06/21/2017".
I use "prmDateClosed = New SqlParameter("@DateClosed", txtDateClosed.Text.Trim)" to save into the table. The data type of the field in the table is "Datetime". It saves in the table as "2017-06-26 00:00:00.000". When I retrieve it back in a gridview it displayes "6/21/2017 12:00:00 AM ". I just want to save in the table as "06/21/2017".  and retrieve as "06/21/2017".

Thanks in advance.
0
I have a Tuple List and need to do a search.

Dim strTaxCodeXREF_List As New List(Of Tuple(Of String, String, String))

This list is very rapidly loaded with 200,000 rows of data, from a text file.  Columns are (TaxCode, TaxDescription, TaxRate)

I need to do a search against TaxCode and retrieve the corresponding TaxDescription and TaxRate.
TaxCode is not unique. I realize that I could simply do a loop and check every row. However, I am seeking a more efficient solution.
I considered using a Dictionary Object but unless I am mistaken,  Dictionaries are limited to two columns. Moreover, Dictionaries require a unique key.

I am a novice to VB.Net and would greatly appreciate any suggestions on the best way to efficiently perform the search.

Thanks much...
0
Hi All,

I have application store inside a folder say "Application"
Every client also have folder "Application'.

Now, every time the client run application, it should sync application that is outdated from server.
Assume there are a lot of file inside the "Application" like *.dll and etc.

How could I do this ?

Thank you.
0
Hi All,

Let's say I've created some rules inside SQL database.
Under Programmability, Rules.

I want to read it from my application to validate user input.

How could I do it?

Thank you.
0
I am getting this error on the ResourceManager: "is not defined" the code is embedded.


Imports System.IO.Ports
Imports System.Windows.Forms
Imports System.Threading
Imports System.Collections
Imports System.IO
Imports System.Diagnostics
Imports System.Globalization
Private Sub mnuLanguage_English_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLanguage_English.Click
        If mnuLanguage_English.Checked Then
            ChangeLanguage("en")
        Else
            ChangeLanguage("en")
        End If
    End Sub
    Private Sub ChangeLanguage(ByVal lang As String)
        For Each c As Control In Me.Controls
            Dim resources As ComponentResourceManager = New ComponentResourceManager(GetType(frmSearch))
            resources.ApplyResources(c, c.Name, New CultureInfo(lang))
        Next c
    End Sub

Open in new window

0

Visual Basic.NET

92K

Solutions

34

Articles & Videos

24K

Contributors

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,

Top Experts In
Visual Basic.NET
<
Monthly
>