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.

View 1 Replies


ADVERTISEMENT

Exposing An Enumeration Through COM That's Declared In A Different Module?

Mar 15, 2011

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

View 3 Replies

SqlDbType Enumeration For A DB Column Declared As VarChar (MAX)?

Aug 25, 2010

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.

View 2 Replies

Enumeration Already Finished?

Dec 17, 2009

Is there a way to check to see if the enumeration is already finished?

View 3 Replies

Get The Value Of A Enumeration Item?

Oct 3, 2009

I have the following enumeration:

Code: Enum E1{ LOW = 'L', MEDIUM = 'M', HIGH = 'H' }

I have loaded those values to a combo box, but how do i display the value of "MEDIUM" (I.E. M), when i select "MEDIUM" from the combo box.

View 3 Replies

Use Enumeration In A Loop?

Feb 27, 2010

Can I use enumeration in a loop? something like this:

Enum Days As Integer
Monday = 1
Tuesday = 2
Wednesday = 3
End Enum

[Code]...

View 2 Replies

Using Enumeration Across Projects?

Dec 4, 2009

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.

View 3 Replies

Can Sort DayOfWeek Enumeration

Jun 21, 2012

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?

View 1 Replies

Enumeration Operation May Not Execute?

May 18, 2012

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

[Code].....

View 1 Replies

Enumeration Select Using Variable Vb

Nov 6, 2011

I have a case where my enumeration is like this:

Public Const PREVIEWCREATE As Integer = -3
Public Const SETUP As Integer = -2
Public Const PREVIEW As Integer = -1

I then have a form post where i recover a string like:

Dim mode_custom_mode = request.Form("custom_mode")

I can do

Select Case UCase(mode_custom_mode)
Case "PREVIEWCREATE"

[Code].....

is there a more direct way in VB to do something like:

t.StartupModeId = StartupMode.(mode_custom_mode) ?????

View 2 Replies

Enums - .NET Enumeration Representation?

Apr 16, 2010

Is it guaranteed that the numeric values for an Enum with only uninitialized values start at zero and increment by one in the order defined?

View 2 Replies

The Given Key Was Not Present In The Dictionary. - Enumeration?

Aug 15, 2011

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

View 4 Replies

Use A Keyword As A Constant In An Enumeration?

Jan 19, 2011

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()'."

View 2 Replies

Using Enumeration In Select Case?

Jun 16, 2009

Enum age
Over18
Under18
End enum

[code]....

'age' is a type and cannot be used as an expression.Is there any way of using enums in "select case"?

View 5 Replies

Using Enumeration Of Class From Form?

Aug 10, 2011

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

View 2 Replies

When Does The Computer Calculates Enumeration

Nov 30, 2009

when does the computer calculates Enum?in other words wiill this 2 be Exactly the same?

dim a = 1
dim a = myenum.value_equates_to_1

i've got a feeling its faster when we do not use enum, just wanted to make sure

View 15 Replies

Add All Of The Items Of An Enumeration Into A An Array Of Strings?

Aug 23, 2010

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.

View 7 Replies

C# - Expose An Enumeration From A Wrapped COM Component

Sep 3, 2010

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

[Code]....

View 1 Replies

C# - Looking For Details On The PixelOffsetMode Enumeration In .Net, WinForms?

Aug 6, 2010

The possible values of PixelOffsetMode are:

Invalid
Default
HighSpeed
HighQuality
None
Half

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?

View 1 Replies

Case Insensitive Web Reference Enumeration

Apr 15, 2012

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.

View 1 Replies

Collection Was Modified Enumeration Operation

Dec 23, 2011

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().

View 8 Replies

LINQ To XML. Enumeration Yielded No Results?

Oct 17, 2009

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.

View 5 Replies

Retrieve An Enumeration From The Output Of A Combobox?

Oct 8, 2010

I have the following Enumeration in my vb.net code:

Public Enum ContactTypes As Integer
ctStudent
ctPartner
ctDocent
ctProjectleider

[Code]...

View 10 Replies

C# - Extending Enumeration Definition In A Child Class In .NET?

Jan 4, 2010

I have a base class which needs to define an enumeration:

BaseClass
- SomeEnum

I then need to create two derived classes from the base class and extend the values in the enumeration:

ChildClass1 : BaseClass
- SomeEnum
- SomeEnumValue1

[code]....

In C# or VB.NET can someone provide the syntax to do this?

View 3 Replies

Collection Modified - Enumeration Operation May Not Execute

Aug 4, 2011

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....

View 2 Replies

Collection Was Modified Enumeration Operation May Not Execute

Feb 17, 2012

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".

View 5 Replies

Collection Was Modified; Enumeration Operation May Not Execute?

Mar 11, 2009

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.

[Code]...

View 17 Replies

Enumeration Warning Access Of Shared Member?

Oct 5, 2011

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

[Code]...

View 5 Replies

Invalid Operation Exception Enumeration May Not Execute

Feb 16, 2011

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

[Code].....

View 1 Replies

MidpointRounding Enumeration For The Math.Round Function

Apr 3, 2008

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.

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved