I'm trying to create a group of engineers (a class) at a specific location (also a class) -- my code is bombing with a NullReferenceException at _engineers.Add(e), and I'm not sure why.[code]
Dim pix() As new List(Of String) = {"*.jpg", "*.avi", "*.mov"} Dim pix As new List(Of String)() = {"*.jpg", "*.avi", "*.mov"} Dim pix() As List(Of String) = {"*.jpg", "*.avi", "*.mov"} Dim pix As List(Of String)() = {"*.jpg", "*.avi", "*.mov"}
I don't have access to VB.NET right now so I can't test this value:Dim lst As New List(Of String)(cookieValue.Split("$"c))i got this from another question , but was wondering if A. The list will populate correctly and B. What does the c represent?
02 Dim initialHeight As Double ' Holds beginning height 03 Dim initialVelocity As Double ' holds velocity 04 Dim time As Double ' holds time 05 Dim heightVal As Double ' holds height at different intrvals in time
I have a Generic.List(Of ImportedVehicle) - ImportedVehicle being a simple class as below.There is an enum property which is marked as public.When I serialize to XML using an XMLSerializer, the enum's value is just set to it's default value (which is NotAllocated) and doesn't actually represent the value that is set in code.[code]
Im having a hard time trying to pass the values from a list inside of a class. Im trying to display multiple lines of values from a list inside of a class. My "client" class stores multiple lines of values into a list(of class transaction), with the number value(num) counting each transaction that it adds to the list.
Code: Public Class Client Private m_tranlist As New List(Of transaction)[code]....
im trying to display each line that is stored in the list in a label, and im having major trouble. I know all of the results are added into the lists, but how do i call the list in my main form in order to display each line of all of the values? Would I have to look up an index or something?
If I have a generic.list(of ClassA), is there a simple way to create a deep copy of this list that will not affect the original copy? It seems to work if I have a generic list of Structures, but for some reason the copy constructor for lists of classes only copies pointers to the elements (or maybe a pointer to the whole list?). I would move to structures if it were not for the fact that I can't find a way to edit the members in the structs in the list. eg:list(0).a = 5 'Does not workIs there some way to get around this without declaring an instance of that structure, like this:dim str as StructA = list(0)str.a = 5I'd
I have upgraded a visual basic 2005 project to visual basic 2010 (.net framework 4.0). I want to list all obsolete functions used in this project in order to change it with newer ones. How can I treat obsolete functions warnings as errors in visual basic 2010 ms-build?
I have several different lists I want to call. They all have the same format for the class: id, value, description, order. Instead of creating a bunch a classes to return the all of the many lists, I wanted to use generics and just tell it what kind of list to return. However, I can not figure out how to populate the classes.
Here are 2 examples of function in my calling code. This should indicate the type of list and the stored proc used to get the data: Public Function getTheEyeColors() Dim glEyeColors As New GenericList Return glEyeColors.GetALList(Of EyeColor)("GetAllEyeColors") End Function [Code] .....
bare with me here ok I posted on here a while back, like month to 2 months ago about creating an array of data (user inputed data). But was suggested to go the class route. After weeks of lengthly reading came up with a list collection class.
I have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.
How can I structure my classes so that the user interfaces though a single class while the supporting classes are hidden from their view? I think its best understood in an example:
Public Class MyInterface Public Economic as EconomicClass Public Sub New() MyBase.New()
[code].....
So you might ask why am I even separating them? It's strictly for others who will be working with this interface. I need to funnel them though a logical structure:
This way everything is already handled for them in the background and they only need to run the method they need. I don't know if I can have it both ways in VB.NET.
code For Each item As Reflection.FieldInfo In GetType(NameSpace.ClassWithNestedClasses).GetFields rtfAppend(item.Name & ":" & Tab & item.GetValue(Me)) Next For Each item As Reflection.PropertyInfo In GetType(NameSpace.ClassWithNestedClasses).GetProperties()
[code]...
which gets me the simple string vars and properties of my top class, but how can i apply this to loop through all sub classes and get there vars and props?
Searching the internet finds no less than 700 different ways and opinions to accomplish what I'm trying to do, and I would just like to know the simplest, most bullet-proof way possible.
[Code]...
I simply want to extract the string "bar," which is inside <hostName></hostName>I can do this easily enough with simple string functions, but I'd like to do it with one of the .NET XML classes/methods.
Sometimes there is a need to initialize the singleton class with some helper values. But we can't "publish" a constructor for it. What is the workaround for this?overloading the GetInstance or setting a color is not my idea. The color should be set only once. I would like to be sure that MyPainter paints ONLY with the initialized color. Any default color should ever be used.
For more clarity I provide a sample:
''' <summary> ''' Singleton class MyPainter ''' </summary> Public Class MyPainter
How can i initialize a CBoolProperty? [code]but when i debug. m_bHeight.Value is always true until i set bHeight with false. I want to initialize it to false.
I can create an ArrayList, but, is it possible to create it WITH some elements already?Normally, your arrays are empty, but what if I want to create an array with a few elements already?
I'm Trying to populate an ASPXComboBox using the InitNewRow event for inserting a new row, but I'm having problems binding the data to the ASPXComboBox.
I have used the CellEditorInitialize event for editing the row and it works fine, but the same principal on the InitNewRow event comes up with an 'object not set to an instance of an object' exception. However, the business logic function which is called returns a fully populated DataTable.
The following code: CodeVariableDeclarationStatement variableDeclaration = new CodeVariableDeclarationStatement( // Type of the variable to declare. typeof(string), // Name of the variable to declare. "TestString");
Produces the following VB.Net Statement: Dim TestString As String
What change would I need to make for it to look like this: Dim TestString As New StringBuilder() I'm interested in how to get that NEW keyword to appear.
I have created a web application in ASP.NET using VB.NET as code behind file. I am using a COM object of ProvideX.Script class to connect to Sage MAS90 ERP. Everything was working fine in visual studio 2010. Now when I moved to the deployment phase, the problem gets started. I deployed my application in Windows Server 2008 in IIS7. When I run the application I get the following exception.[code]...