Visual Basic.NET

93K

Solutions

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 am trying to hide the chart axes and labels along with the series line color. I just want to show datapoint labels. I have successfully hidden all (by setting color to form's back color). However except for the dashes that appear at axes scale break points. (Please see the below image)

scalebreaks.PNG
Could someone please help me with hiding these scale break dashes as well? Thanks in advance
0
PMI ACP® Project Management
LVL 12
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Is it possible to place custom labels on a StripLine? I have a Horizontal stripline and want to place custom labels on some datapoints on this line. Could someone please give me code to do this? Thank in advance
0
How to restrict vertical stripline from x-axis to above x-axis but restrict it from extending below x-axis.

As you can see in the image below the current green vertical line is extending onto the side of negative Y-axis (i.e; below x-axis).

current_chart_mockup.PNG
How can I not show the part of green vertical line below x-axis (indicated by red arrow)
Please let me know how to accomplish this. Thanks in advance.
0
I have a chart currently generated as shown in the image current_chart_mock.png

current_chart_mockup.PNG

Is it possible to add labels below  few x-axis values. Please see the below attached image (MAP_mock.png) for what I am trying t ask for.

MAP_mock.PNG
If possible, could someone please tell me how to accomplish this? Thanks in advance
0
How can I tell i a text file has tabs in it? I have  vb.net code, but it is not recognizing the tabs, so I am wondering if there are actually tabs in the text file.
0
I am trying to figure out a way to implement on a WCF Service that is version agnostic basically.

[DataContract]


public class TestResponse
{

    [DataMember]
    public string StudentNo {get; set} 

    [DataMember}
   pubiic ClassVersion VersionOfClass [get; set;]

}

[DataContract Name="Class A"]
public class TestClass
{
      [DataMember]
      public string Tools {get; set;}

      [DataMember] 
      public string Name {get; set;}

}


[DataContract Name="Class B"]
public class TestClass
{
      [DataMember]
      public string LocationType {get; set;}
      [DataMember]
      public string Name {get; set;}
      [DataMember]
      public int NailDepth {get; set;}

}

Open in new window



Now, I want to be able to use that TestResponse and the ClassVersion object be for the ClassA or ClassB.


Is that possible to be done if is go how? I don't think a Generic would work. Would a typeof?


Any information on this would be greatly appreciated.


Thanks!
0
I have a datagridview whose styling is kept as follows

    dgvCreatinine.AutoGenerateColumns = False
            dgvCreatinine.AutoSize = False
            dgvCreatinine.AutoResizeRows()
            dgvCreatinine.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
            dgvCreatinine.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders)
            dgvCreatinine.DataSource = dtTemp

It is appearing as shown in the attached image

datagridview_style.PNG
As you can see the gridview is not resizing to the content along row wise. Could someone tell me how this can be accomplished? Thanks in advance.
0
I have two series with Legends being added to a chart in vb.net

creatinine_series.LegendText = "Creatinine (mg/dL)"
creatinine_series.IsVisibleInLegend = True

chrtSubject.Series.Add(creatinine_series)
and

urineOutput_series.LegendText = "Urine Output(ml/kg/hr)"
urineOutput_series.IsVisibleInLegend = True

chrtSubject.Series.Add(urineOutput_series)
But only urineOutput_series legend shows up. creatinine_series legend doesn't showup. I have no clue why this isn't appearing.

Also I would like to position two legends (If both of them show up). How to position them. Please kindly help me get though this issue.
0
Hi
in my asp.net web application
what vb.net code would I use to read the e-mail headers and bodies of all unread emails in my inbox
then Mark each e-mail as read
1
Hi

We have a simple application that was done by a predecessor. All it does is allows users to enter 'item numbers' and send to print. The item data is saved on a separate excel sheet in the same folder. All dll files, EXE. file and excel file are in the same folder. I've just copied this folder to a new machine trying to replicate the process. I can run the application but when I click send to print button on the application I get below error;

"Unhandled exception has occurred in your application if you click continue the application will..."

"could not load file or assembly microsoft.reportviewer.common version=12.0.0.0..."

I've tried installing the relevant files for above exceptions. However, think this is to do more with the 'Print' button on the application and coding behind it.
Please see attached.

Can someone advise what I need to do to get this to work please?

Thanks in advance.
Exception-Issue.docx
1
CompTIA Network+
LVL 12
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

threading.timer does not always start.
i start one threading.timer   that should check after 80 miliseconds if a write to serial port is stuck.  if it is stuck, it purges the comm port and tries to write again.
the problem is that sometimes it works,  and some times the thread does not start.  does anyone know about this behavior ?  and can this be fixed ?
it is running on a win ce  with visual studio  2005.
the write takes 3 miliseconds,  but when it get stuck,  it can take from 10 seconds to 20 seconds,  so checking after 80 miliseconds  seems good.
the code:

               If g.timerStarted = False Then            'starting the timer only one time
                    tTimer = New Threading.Timer(AddressOf tTimerTick, Nothing, CInt(80), CInt(80))
                    g.timerStarted = True
                Else
                    tTimer.Change(CInt(80), CInt(80))
                End If
             
                    doWriteToComm(InSendStr, InDevType, CommResult, RealWriteBytes)      
           
           
                tTimerClose()   '  here i change the timer to  tTimer.Change(Timeout.Infinite, Timeout.Infinite)

thanks.
1
Hello Again Experts.

I must apologize in advance for my brevity, but I recently injured my hand in the wood shop, and typing is somewhat difficult.

The situation that I am dealing with right now is that I am very frequently experiencing conflict between changes that I make in my Access tables/queries, and keeping my VB.NET Windows Forms app in sync with these changes. For example, if my program is stable with no DB issues, and I decide that I want to add a new field/column to a given table using Access, when I return to my program, it invariably produces errors related to the changes I make.

Today I made a change to an Access Query which is attached to a DataGridView in which I connected a new table to get a related field value. The Query works fine in Access, but now not only does the program fail to compile because of the DGV association, but the Data Source Configuration Wizard shows what before was a View is now a broken Table!

I'm pretty sure that Visual Studio stores a boatload of data pertaining to my database, and that needs to agree with the MDB file, so I just need to know that correct way to make minor changes to my tables and queries. Ultimately what I'm hoping to accomplish is to find a way to have ONE source for my database definitions, and just have a file (or files) store the data.

I realize this is not a lot to go on, but that's all I can offer for the moment.

Many Thanks,
Tony G.Example Error Condition
0
For a stored query (name is "CREAT_Plot") like the following in Access, what would be the vb.net or C# code to call this query and also pass a parameter in place of "[Reports]![TestReport]![Subject]"

SELECT CREAT.Subject, CREAT.CREAT, (IIf([CREAT.TargetDays]=".",".",Val([CREAT.TargetDays])*24)) AS TargetDays
FROM CREAT
WHERE (((CREAT.Subject)=([Reports]![TestReport]![Subject])))
ORDER BY CREAT.TargetDays;

I have googled about this but could not find an example to call stored query that prompts for input parameters.
Please kindly give me small code snippet to achieve this one.

Thank you
0
Hello,

I'm trying to load multiple results into a reportviewer.  I'm having the user select multiple rows in a datagridview then click a button to load those into a reportviewer form.  It works fine for a single event and associated sub table data.  I envision having the reports sequentially page after page but I'd also be fine if it opened up multiple reportviewer forms ready for printing or saving.  I'd have to limit the total number of openable events I suppose, otherwise a user could open hundreds and that would bog down or fail but that should be easy.  

I played around with a query to capture all the events by serialno using an IN statement in the query builder for the dataset, but I kept getting an error and the reportviewer may not be able to handle it anyways so I thought I would ask before spending too much time on that.

Here's my attempted code that opens only the last selected event in the reportviewer:

       Dim selectedRowCount As Integer = Form1.dgResults.Rows.GetRowCount(DataGridViewElementStates.Selected)
        Dim SerialNo As Integer = Nothing

        For i = 0 To selectedRowCount - 1
            SerialNo = Form1.dgResults.SelectedRows(i).Cells("SerialNo").Value
            Debug.Print(RecordSerialNo)
            Try
             
               
                Me.IAdapter.Fill(Me.DataSet1.I, SerialNo)
                Me.pAdapter.Fill(Me.DataSet1.p, SerialNo)
                Me.vAdapter.Fill(Me.DataSet1.v, SerialNo)
                

Open in new window

0
I have a form with a Datagridview on it and I need to filter it on a field called BulkSaleNumber. I need help with the statement to filter the Datagridview for all records where the BulkSaleNumber =0. How do I filter the Datagridview so that it will list only those rows where the BulkSaleNumber =0?. Please see my code below.


    
        Private Sub frmBulkSale_Load(sender As Object, e As EventArgs) Handles MyBase.Load
             'TODO: This line of code loads data into the 'AssetDatabaseDataSet.tblAssetData' table. You can move, or remove it, as needed.
              Me.TblAssetDataTableAdapter.Fill(Me.AssetDatabaseDataSet.tblAssetData)
        End Sub

Open in new window

0
How can I convert this HEX string to a readable result? I get this string returned from a device I am sending a function to. What can I use to parse and represent the actual result from the device?

HEX String
0
I have attached a screen shot with what I am trying to do. I want the second form to be placed inside the first form. However I am not using any MDI function. Is there a an "offset" that I can add in to the second form? I know the .location of the first form on the screen.

Thanks in Advance.


Example Screen Shot
0
I am develop application using VB.Net with SQL Server, and i use dataset to bind data to GridView, but my Field is stored Unicode Character (Khmer Unicode) with collation 'Khmer_100_Bin". To select data from this field correctly i need to use prefix N' , But my concern is i am using dataset with variable @a so i don't know how to use prefix N with that variable, anyone can help me about this?

Note:: My dataset Query is in picture attached.

Thanks in advance.

0
I'm writing a COM component, basically an enumerable class (so I can use the for .. each loop from VBA).

I managed to write the Following wich work:
<ComClass(FieldValidators.ClassId, FieldValidators.InterfaceId, FieldValidators.EventsId)>
Public Class FieldValidators
    Implements IEnumerable

#Region "GUID COM"
    Public Const ClassId As String = "2d368af9-55a7-4cca-a79d-06b6c3a91554"
    Public Const InterfaceId As String = "5094acfa-2799-491d-b7f0-ebc4a2d0e755"
    Public Const EventsId As String = "a31bb5c3-99c6-4548-85cc-fbe83d407867"
#End Region

    Private mFieldValidators As List(Of IFieldValidator)

    Public Sub New()
        MyBase.New()
        mFieldValidators = New List(Of IFieldValidator)
    End Sub

    Protected Overrides Sub Finalize()
        mFieldValidators = Nothing
        MyBase.Finalize()
    End Sub

    Public Sub Add(ByRef validator As IFieldValidator)
        mFieldValidators.Add(validator)
    End Sub

    Public Function Count() As Long
        Count = mFieldValidators.Count
    End Function

    Public Iterator Function GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
        For Each fieldValidator In mFieldValidators
            Yield fieldValidator
        Next
    End Function

    Default Public ReadOnly Property item(ByVal index As ULong) As IFieldValidator
        Get
            item = mFieldValidators(index)
        End Get
    End Property
End Class

Open in new window

But the resulting enumerator is poorly typed (IEnumVARIANT), I would like to return objects of type IFieldValidator.

Is it doable ?
0
Learn Ruby Fundamentals
LVL 12
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Hi,
I am working with crystal reports in VB.NET 2008.  I need to understand that how can I insert a page number in the details section.  Please note it has to be in the details section. I've tried the traditional way of placing the special field "page N of M" in the details section but while printing multiple pages for a single record, it only appears at the end of the record, while what I need is that it should appear on each page and get reset for a new record.  Will I have to create a formula to accomplish this.

Thanks in advance.
0
Hello.  I am creating XML files including schemas based on several tables in an MS SQL database:

SELECT * FROM [OurDB].[dbo].[Table1] FOR XML AUTO, ELEMENTS, XMLSCHEMA

Open in new window


From a VB.NET WinForms app, I receive the XML output as a string.  I am trying to take these XML strings and create NEW tables that match the schema in the XML as well as the row data.

At first I thought the datatable.ReadXML function would be able to read SQL XML files as-is, but they do not.  There is probably a better way to do this, like a Stored Procedure that takes the XML as input, uses the schema to automatically create a new table, and then import the rows.  I just can't find an example online.

I am a first-time poster, please forgive me if I didn't include enough info or did anything else wrong.  :)  Thanks!
0
Using vb.net is there a way to get .Net FrameWork and IIS versions?
0
How do i allow my desktop software developed in vb.net automatically detect  updates online and also to do updates onlines
0
Hi,

I'm trying to build a simple COM component (class Library) usable with from VBA, but so far it isn't working as expected (I recieve a DLL loading error whenever I try to add a reference).

I'm using Visual Studio Community 2017 / Visual BAsic.Net /  .Net Framework 4.6.1, the source code compile, the COM component is Registered, but no way to add a reference to it.
What did I miss ?

For record, here is the source code:
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1

#Region "GUID COM"
    ' Ces GUID fournissent l'identité COM pour cette classe 
    ' et ses interfaces COM. Si vous les modifiez, les clients 
    ' existants ne pourront plus accéder à la classe.
    Public Const ClassId As String = "2f55bb60-0e65-4056-b6cb-d4883b531da6"
    Public Const InterfaceId As String = "5fdb7171-a274-4ee8-94b9-4346050233f5"
    Public Const EventsId As String = "b451bac4-a9b5-4874-bc36-e292dfdf33c5"
#End Region

    ' Une classe COM pouvant être créée doit avoir Public Sub New() 
    ' sans paramètre, sinon, la classe ne sera pas 
    ' inscrite dans le Registre COM et ne pourra pas être créée 
    ' via CreateObject.
    Public Sub New()
        MyBase.New()
    End Sub

    Public Function getValue() As String
        getValue = "bla blah"
    End Function

End Class

Open in new window

0
I'm using the MSChart in vb.net and it works fine a few times then eventually gets a memory error.  I'm pretty sure the error occurs on execution of this line:

MSChart.Plot.SeriesCollection.Item(Column).DataPoints.Item(-1).ResetCustom()

This isn't my code, just trying to support it so I'm not really sure what it's doing or why it's failing.

Here's the error:  -2147467261: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Any ideas?  Thank you so much!
0

Visual Basic.NET

93K

Solutions

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,