IDE :: IntelliSense Doesn't Display Certain Enumeration Values In A .NET Project If Enumeration Is Declared Within A C# Assembly
May 28, 2010
I have just received an interesting feedback from a VB.NET customer using our product - for some reason intellisense hidden a certain enumeration value.After a small testing I have found that this is likely a bug in IntelliSense: [URL]..To be honest, I did not expect this problem with such a basic stuff like this. Have you seen this in the past? For me, it doesn't work in all VS versions...
Anyway, feel free to track this issue if you are coding in VB.NET.
I have a .NET library that needed a COM wrapper around it so it could be called from VB6ish programs, in this case specifically Microsoft Access XP I have a type that's declared in one of the classes that went into the .NET library. I thought since its public, it would be seen, but it didn't show up in Access. And yes, we made the TLB file and registered the COM interface. I had to move the type declaration into the COM module, which I really didnt want to do. Is there a way to export a type/enum through COM without actually declaring it in the COM interface Scott Berger McCormick Systems
My Data base a a column called BIG VarChar(MAX).I can't find a SqlDbType for my paramter definition in VB.net that matches it.VarChar with no size compiles but does not work.Var Char(MAX) does not compile.
I have a Windows Forms UI, a Class Library, and a WebService. I need to be able to pass an Enumerated type through each of these layers (SystemType). For instance, the UI passes the type to the class library, which then passes the type to the Web Service.My question is, where do I define this enumeration type so they all know about it.
Options so far:
- Each project contains the exact same enumeration.
- Put the enumeration in its own project and reference this assembly from each of the other projects.
I am trying to figure out if the DayOfWeek Enumeration list can be sorted by using the integer value (ie Sunday = 0). Ultimately I want to take the DayOfWeek Enumeration list and population a dropdownlist with the days of the week from Sunday - Monday and I do not want to hard code the items in the HTML markup. Is this possible?
I have some code that i cant work out why its happening and how to fix it. What im attempting to do is loop through the controls in a gridview and replace it with another control along with the text
Dim i As Integer Dim row As GridViewRow Dim rowCell As TableCellCollection = row.Cells
I've been getting the following error from time to time and have been unable to determine the cause of it:"The given key was not present in the dictionary."The line that this is occurring on is:If CType(ViewState("FieldType"), MYClass.FieldType) = MYClass.FieldType.ShowOnDirectory ThenI have no idea as to why it is throwing this exception on this line. I thought that perhaps an invalid value was being placed in the ViewState so I tried while debugging setting the value to Nothing and setting it to a value that wasn't in the enumeration and it still works. I was originally storing the enumeration in ViewState and then went to storing just the Integer equivalent in there
I would like to use a keyword (reserved word) as a constant name in an enumeration.The reason I care about the name is I set a ListBox.DataSource to the .GetValues of the Enum Type.This way the list of constant names show up in the list box and the ListBox.SelectedValue can be tested to determine which constant value has been selected.What I would like to be able to do is as follows:
Enum Style As Byte
[code]....
This was an attempt to override the Name property from S to Single However I get a pre-compile error stating: "Too many arguments to 'Public Sub New()'."
I have a form event that calls a public function in a class. I am trying to use an enumeration that is in the class from my form, but I'm getting a green squiggly line under clRS.enmProcedure.SetReady.
The error says this: "Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated."
Private Sub dgvResults_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvResults.CellContentClick If clRS.pubfnc_UpdateResults_M(dtResultID, Me.dgvResults, clRS.enmProcedure.SetReady) = "Failed" Then Exit Sub End If End Sub
add all of the items of an enumeration into a an array of strings....
1 Enum Test apple = 0 plum = 1
[code]....
If possible I'd like to dynamically at the start of my code be able to add apple, plum, carrot and scotch to the contents of an array (really a combobox) and if I have to had another item to the Enum that it automatically be added to the array.I seem to keep having to add vendor names (replacing produce/liquor) and I need the items to show up in a large project in many places and it's a pain to have to add the item to each every time.
I'm writing a class library in .NET that wraps a COM dll and exposes specific functionality to be consumed by other .NET code. The COM library has several enumerations defined and I've used some of the enum types as parameters like so:
//C# public void TransactionTypeSetByEnum(COMComponent.TransactionType transType) { this.TransactionType = transType
I'm guessing that HighQuality = Half, HighSpeed = None and Default = HighSpeed. If this is true then, like the SmoothingMode, I can offer just two simple options.Does anyone know if this is correct and, if so, where on earth did you find the information?
I created a Web Reference (also tried Service Reference) to a WSDL that had the following node inside an xsd: <xs:element name="filter"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element minOccurs="0" maxOccurs="unbounded" ref="condition" /> <xs:element minOccurs="0" maxOccurs="unbounded" ref="filter" /> [Code] .....
This wouldn't build in a VB project because VB.NET is case insensitive. I tried deleting one set of and/or, but when the XML is created, it simply ignores the selected value. I also tried appending an X at the end of one the sets which also failed. Is there a way to make this work? I also tried updating the XSD so it just had two values without success. The interesting thing to note is that default is set to "and" and while debugging it will set it to and, it doesn't actually produce the node attribute of it just generates.
I get that error any time my form closes(Me.Close), even if I don't do anything to the form at all exept load another form like this: Form2.Show Me.Close().
I'm having trouble populating an object from an XML file. I've copied an example I've found almost exactly, with variable names changed, but I keep getting the "Enumeration yielded no results" exception.
Here is my code:
[code]...
Essentially, the XML query is supposed to return the title and the description for every Property which has an element called Language Code, which is equal to "en-us". I have a feeling that my problem lies in my XML code, but I've been stuck here for a long time now.
We have some third party code that is causing some misery at the moment due to throwing the above error: it is slightly odd because it is an intermittent error. Here is the method that is causing the issue: Private Shared Sub IntLocateDictionaries(ByVal haystack As ExpDictionary, ByVal needlearray() As Object, _ ByVal resultarray() As Object, ByVal removemarks As Boolean) Dim i As Integer Dim item As Object [Code] .....
I understand that this error is usually caused by trying to modify a collection whilst enumerating around it, hence why I've added logging on the only line that looks like might alter the collection... Since adding the logging we have still experienced the issue but NO LOGGING appears: this isn't surprising since if you look at the parameters on the calling line (the only place this Sub is called from) - removemarks is passed as False - this will be passed all the way down through the recursive calls and so that line which calls .Remove never gets executed....the fact we don't see logging proves this....
I am working on a project where I have a personnel class. The records stored in the class are populated a few records per second. At the time I am inserting the records, I have to check the same class to ensure the same record is not added twice. Since I am looping through the class using "For Each", I get a message "Collection was modified; enumeration operation may not execute".
i'm getting the following error: "COLLECTION WAS MODIFIED; ENUMERATION OPERATION MAY NOT EXECUTE."
The stack trace is ;
at System.Collections.SortedList.SortedListEnumerator.MoveNext() at SatcomDiscoverySocket.clsGatewaySend.SendViaGatewaySend() in C:Documents and Settingsjim.SATCOM_DOMAINMy DocumentsVisual Studio 2005ProjectsSatcom Discovery Socket ServerSatcomDiscoverySocketSatcomDiscoverySocketThread PollingclsGatewaySend.vb:line 60
The line in question is but I don't believe that to be true I think its the line above it;GatewaySendEntry = Nothing The code is below. I can't figure out why, it's causing the error at that line and how to fix it.
I created an enumeration in a class library... and compiled it into a dll
Public Enum TestEnum x = 0 End Enum
I then imported this reference to a windows form project as a referenced dll Public Class Form1 Dim mytestenum As TestPublicEnum.TestEnum Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
I have a dataset returned after executing a sql query. below is my code to access the returned dataset and I seem to get this error sometimes and not all the time this code executes Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed Dim currentMethod As String = MethodBase.GetCurrentMethod.Name
I was wondering if someone could explain the logic behind the MidpointRounding enumeration for the Math.Round function. The two enumerations are AwayFromZero and ToEven where, based on the given precision, the former will return the nearest value away from zero toward positive or negative infinity (based on the value's sign) and and letter will provide the nearest even number.