IDE :: Inconsistent Behaviour When Filling Arrays?

May 29, 2010

This works:

Dim zArray(5) As String
zArray = (From zS As String In zArray Select "HelloWorld").ToArray

This doesn't:Dim zArray(5) As String = (From zS As String In zArray Select "HelloWorld").ToArray

It seems inconsistent to me, though I may be missing a subtle difference instead of it being an IDE inconsistency?

View 3 Replies


ADVERTISEMENT

Inconsistent Combobox Behaviour?

Sep 12, 2011

I have an application which was developed in vs2005 with numerous forms which use the combobox for selecting from lists of items. The usual setup is as follows:

Combo.Datsource = BusinessObject

Combo.DropdownStyle = DropDownList

Combo.AutoCompleteMode = SuggestAppend

Combo.AutoCompleteSource = ListItems

However, compiled under vs2005 when tabbing to a combo and typing a number of characters the combo would highlight the first matching item and on pressing tab, would select it and the user would move to next field.

With vs2008 the same item might be highlighted but pressing tab doesn't select the item unless its the only item matching the first character. The only way of selecting the item highlighted from the suggestappend is to press enter prior to the tab key.

I also noticed some users experiencing the same behaviour when the app was compiled with vs2005 on some PC's but not others as if it had something to do with the PC config.

Has anyone any ideas how to get around this as it can lead to errors in data capture.



Kind regards.



View 8 Replies

Reasons For Inconsistent .NET Syntax?

Jul 8, 2010

Does anyone know if there's any particular reason that VB.NET construct syntax isn't consistent? For example:

If End If Select End Select You'd assume it would be for... end for, while... end while ... but instead we have:While.Wend For Next This has mildly frustrated me for a while, and I just got to wondering whether there was any conscious decision behind it. Or was it just an initial not-so-well-thought-out design decision that can no longer be changed because of backwards compatibility problems?

View 3 Replies

.net - Inconsistent Behavior From Declared DLL Function?

May 21, 2010

Why might my GetRawData declared function return a correct value when called from my VB.NET application, but return zero when called from my ASP.NET page?The code is exactly the same except for class type difference (Form / Page) and calling event handler (Form1_Load, Page_Load).

Note: In the actual code, #DLL# and #RAWDATAFILE# are both absolute filenames to my DLL and raw data file respectively.

Note: The DLL file was not created by Visual Studio.

Form1.vb
Public Class Form1
Declare Auto Function GetRawData Lib "#DLL#" (ByVal filename() As Byte, _
ByVal byteArray() As Byte, _

[code]....

View 3 Replies

.net - Xaml TextBlock Width Inconsistent ?

Jan 18, 2012

Look at this simple bug :

<textblock (...) Width="0" />

Working great, the textBox appears to be 0px thin. Works with value like, 2, 3, 4...

Now that is NOT working :

<TextBlock (...) />
<TextBlock.Width>
<MultiBinding Converter="{StaticResource WidthConverter}">

[CODE]..................

Why can i set zero value to TextBox.Width in xaml and not in code behind ? By using a converter, when returing 0, the TextBlock.Width is not set to 0 but to "auto", i can read the text

View 1 Replies

IDE :: Treeview With Imagelist Inconsistent Behavior?

Dec 10, 2009

I have a treeview with Imagelist assigned to it. I find inconsistent behavior with the Images being displayed in treeview. When I run the app sometimes the images show up and sometimes they don't.

View 4 Replies

Inconsistent Line Endings Error

Apr 17, 2011

I wrote a software for auto-generating some lines of code. However when I do a copy and paste of that code in a class after reopening it again I confront an Inconsistent Line Ending Erros.[code]...

View 2 Replies

VS 2005 Contextmenustrip - Inconsistent Dropdown?

Apr 6, 2009

I've got a contextmenustrip with a couple levels of dropdowns (submenu items). Let's say I right-click the form and show the "main" set of items, one of which is "Food". If I move the mouse over Food (not click it), a dropdown (submenu) for Food should open, which it does. But then, say, one of the food items is "Fruit". When I move the mouse over "Fruit", the Fruit submenu should open automatically - but it does not always - sometimes it does, but sometimes I have to click it to open it. Furthermore, once "Fruit" has been clicked once to open, any other dropdown items (let's say we had "Veggies" and "Meat") will automatically open as I expect; and then "Fruit" will behave as expected also.

Any ideas on how to correct this inconsistent behavior? (i.e. all sets of dropdowns associated with a contextmenuitem should open when the mouse is moved over it, a click should not be required)

View 2 Replies

OLEDB For Excel: Inconsistent Insert Results?

Jan 13, 2010

OVERVIEW:I am currently having an issue loading a large number of rows into Excel. I say large because the attached code in fact correctly inserts 50 rows into an Excel worksheet, however, as the number of rows increases to no more than500 rows the data is not inserted into the worksheet. No error is thrown by .net and the .xls filesize actually shows an increase in size, however, when the file is opened there are no rows in the spreadsheet..... Then, when the .xls file is closed the filesize is once again reduced.

Again, the code works for a small number of rows. Are there any known bugs with the OleDB driver for Excel?ADDITIONAL THOUGHTS:I have tried inserting rows to both Excel 2003 and 2007, same issue.I have tried closing the connection after each insert.... performance if horrible and it does not fix the problem.I have wrapped the ExecuteNonQuery in a transaction.... no go....

[code]...

View 1 Replies

Parallel.For With Nested Loops Causing Inconsistent Iterations?

Dec 23, 2010

I'm trying to implement parallel computing using .NET 4 on an asp.net website housed on a clustered server consisting of 6-8 dual core servers. My original script contains two nested For...Next loops iterating through a range of values in a grid of x by y.

For each point in the grid (x,y), we should perform a computationally intensive subroutine called MakePartsMatrix which accesses a SQL server database with dataviews and manipulating the local variable "unfilled" which is passed in ByRef.

Without the parallel implementation, the nested for loops work fine except its slow -- taking about 60 seconds to run.

When I parallelize the outer For loop, the script is about 50% faster, completing its calculations in 20-30 seconds which is great. However, I have noticed that the parallelization causes random parts of the grid to be either completely skipped (eg, grid (1,5) is never evaluated by the MakePartsMatrix), or some points in the grid (eg, x=10 & y=5) to be evaluated multiple times, resulting in duplicate work.

When I parallelized only the inner For Loop, the script execution time also improves by 50%, but now the last row (y-1) in the grid is skipped entirely and the results in "unfilled" are completely wrong.

When I comment out the "MakePartsMatrix" subroutine, the parallellization (either inner or outer For loops) does appear to visit every point of the grid (x,y) once, and only once.

Dim ConcurrentListofResults As ConcurrentQueue(Of FindBestResults)
ConcurrentListofResults = New ConcurrentQueue(Of FindBestResults)
Dim FBSResultsItem As FindBestResults

[Code].....

View 11 Replies

Unit Test Inconsistent Pass Or Fail Result?

May 16, 2011

One of my unit tests seems to randomly pass or fail when I run it. The only thing that makes sense to me for why this is happening is if the data in the database is getting into a different state each time the test is ran, but I use transactions to rollback the database in each test - unless it's not working right. Here's my base unit test class and the unit test class that's having the problem. Can you see anything I might be missing or what else I should look for?

This happens with TestDriven.Net and the Visual Studio Unit Test Framework.

[Code]...

View 3 Replies

Different Behaviour Between PrintDocument And PageSetupDialog?

Mar 11, 2011

In a program I am using the standard PrintDocument, PageSetupDialog and PrintPreView controls. I am attempting to print a screenful of information which covers three A4 printed sheets. The printed format is OK except that the positioning on the page. Changing the margins in the PageSetupDialog makes it worse.So I wrote the following code in the Form Load event to see what was going on -

While
True
Dim
MsgStr As

[code]....

View 3 Replies

Put Behaviour Logic When Using POCOs?

Jan 26, 2011

I never used POCOs, so I have the habit of putting a lot of logic in my business object classes. Hence I believe I'm missing some important concepts about class-layouts, and the thought-process that is needed here.

Say if you have two classes; Company and Employee. Could you give some examples of what classes you would build "around" these that take care of various behavior/validation etc.? (Like some class names, and a brief description of their purpose)

View 2 Replies

Strange COM Behaviour Called From .net?

Oct 13, 2010

i am working on an application which calls the COM component of a partner's application.Ours is .Net, theirs isn't. I don't know much about COM; I know that the component we're calling is late-bound i.e.obj As Object = CreateObject("THIRDPARTY.ThirdPartyObject")We then call a method on this COM object (Option Strict Off in the head of the VB file):obj.AMethod(ByVal Arg1 As Integer, ByVal Arg2 As Integer, ByVal Arg3 as Boolean)I am a bit nonplussed that even though this call works, this overload doesn't exist in the COM interop .dll that is created if I instead add a reference to the COM server using Add Reference. The only available call to this method that it says is available is AMethod().

View 3 Replies

Cannot Open Newly Created File - Inconsistent Line Ending

Jan 20, 2010

I wrote a program that writes to a new created file a line of text. Anytime I try to open the new created file, I see a dialog box titled "Inconsistent Line Ending". I do understand why I receive this message. I wrote this program in VB.NET.

View 1 Replies

Chart X Axis Labels - Label Display Is Inconsistent - VS 2010

Aug 2, 2011

I'm seeing a strange problem with the labels on the X axis of my charts. I've setup two chart areas and aligned them (which displays fine) and the user can manipulate the chart by selecting different date resolutions (Year, Month, Day, Week, Hour) and different time periods.

The issue I'm seeing is that if a user selects say Months as the date resolution the X axis label display is inconsistent. If a fairly broad range for the dates is selected the X axis displays absolutely fine but as the date range narrows the X axis starts to duplicate labels ( please see the attached images). The second Image had a date range of 1st of May to 1st of August and as you can see the labels are duplicated. This is my first go with the chart control so I could be missing something basic. [Code]

View 1 Replies

VS 2008 - Process.Start() - Inconsistent - Load A File On Network

Oct 22, 2009

Im simply trying to load a file on my network. The file is a database file for access.. This code opens the file on my computer. However on the four computers tested 2 of them throw an error stating that the user canceled the operation. However the user didn't do anything. The error is thrown automatically. The other two are working perfectly fine.

[Code]...

View 2 Replies

VB6 Used Recordsetsor Arrays - .Net Framework In VB2010. Datasets, Dataviews. Tableadapters, Arrays. Enums ?

May 9, 2010

In VB6 I load a recordset containg all of the records (6 fields per record)in a table into an XArray and then manipulate the records in the array and then write them back to the original table. The array issorted by the first field (1 to maybe 8000 or more) I need to find records in the array by an ID field and then move them (because of some external criteria that happens many times) from say number 400 to number 375. Then all of the other records between 375 and 399 were renumbered up 1 to fill the gaps left by the move.

The XArray worked well as it could find and also move to a next record easily to facilitate the revisions to each record quickly. Everything is done in VB6 in code and nothing visual needs to be shown to the user until say 2000 of these external changes are complete. What is the best, most efficient way to do this in the .Net framework in VB2010. Datasets, Dataviews. tableadapters, arrays. enums ?

View 3 Replies

.net - Different Behaviour When Using Response.Redirect And SiteMaps?

Oct 7, 2011

My ASP.NET (VB.NET) application uses SiteMaps to display a navigation menu on the top of each page. In the code behind of some of the pages, I am dynamically amending the URLs of the SiteMaps nodes (to add parameters to the end of the URL) e.g. say I have somePage.aspx.vb and anotherPage.aspx.vb and they both contain the following:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AddHandler SiteMap.SiteMapResolve, AddressOf Me.ExpandForumPaths
If Not Page.IsPostBack Then
Setup()

[code]....

My problem is this, if I am in the code behind of somePage.aspx and I do a Response.Redirect("~/anotherPage.aspx") - then, when anotherPage.aspx.vb is being loaded, it is the ExpandFormumPaths method of somePage.aspx.vb that is hit, not that of anotherPage.aspx.vb.

My understanding is that a Response.Redirect tells the browser to do a new request to the supplied URL - I don't know why it's hitting the method belonging to the previous page.

I've tried amending the method names (i.e. not having the node processing method called ExpandFormumPaths in all classes) but I still encountered the same issue.

When I go straight to the URL of anotherPage.aspx the correct method is hit, it is only when I am using Response.Redirect that this happens.

View 3 Replies

C# - Using IHTMLElement5/6 (for IE8/9) In IE6/7 - Does It Divert To IHTMLElement Behaviour

Mar 8, 2012

Basically, IHTMLElement5 and IHTMLElement6 are all extended interfaces for the main IHTMLElement as per the versioning rules below:

IHTMLElement IE4
IHTMLElement2 IE5
IHTMLElement3 IE5.5
IHTMLElement4 IE6
IHTMLElement5 IE8
IHTMLElement6 IE9

Of course, each new extended interface has the old members in it + its own new members, properties etc. However, some of the members (for instance, .getAttribute) are the same name but have been updated. So, my question is, if I use (say) IHTMLElement6 to declare my HTML Element and run the code on a client that only has IE6 installed, when will my object just fail and remain as Null/Nothing when I set it, or is mshtml.dll smart enough to realize whats going on and defaults to IHTMLElement4 (actually, IHTMLElement) behaviour?

Just to clarify the last statement in brackets, .getAttribute was added in IHTMLElement and updated in IHTMLElement5 and IHTMLElement6 - so, if someone has IE6 installed only, then I would expect the behaviour to default/revert back to IHTMLElement (not IHTMLElement4) - and if it does not do that, then I expect my code to crash. Basically, my question is, what will happen exactly?

Summary of Question (read if you find necessary, just a reclarification for those who need it):Basically, I want to be able to declare something as IHTMLElement6 so I can make use of the updated methods which have the same name between IHTMLElement and IHTMLElement6 (such as .getAttribute). This way, on IE9 users IHTMLElement6's version of .getAttribute will be taken advantage of, while at the same time IHTMLElement's version of .getAttribute will still work for (say) IE6 users without breaking my code - this is the point where my question comes in, when using a IHTMLElement6 object, even though it is an IE9 interface, will IHTMLElement's (IE4 interface) version of .getAttribute kick in/work or will I get a null reference exception or other runtime error?

View 2 Replies

Class Names And Namespace Behaviour?

Sep 5, 2010

1. create a blank VS2010 web project called "MySite" targeted at 4.0

2. create a new class object, calling it "class1.vb" (cause it's so unique!!)

3. change default code to read as such...

Namespace MySite
Public Class Functions
Public Shared Function WhatIsTodaysDate() As String
Return Date.Now.ToLongDateString

[code]....

Why is VS asking me to call the namespace twice if I use the "Imports" directive?I'm sure this has got something to do with VS2010 and the 4.0 framework.

View 2 Replies

Irradiate Startup Behaviour In VS2008 And GC?

May 6, 2009

If VB5/6 could read Unicode I would remain in it for ever as it is to me the most efficient way of getting all things done, and I have likely done more in VB classic than most care to try on VS.NET Now, in the midst of trying this system I keep a red light lit in the back of my head, on constant alert due to the GC part of .NET.

No matter what I read, I just get more precarious about the implementation of a Garbage Collector in VB, as this means I cannot absolutely say that a username and password is cleared from memory when I want to.In spite of tallking directly to Mr Bjarne Stostrup (the inventor of C++) and reading two ebooks of a few hundred pages each over the past night, some things still boggles the mind.

Such as...Why in heavens name does the MSDN library opener say "Help is updating to reflect your recent changes. This may take several minutes"Well its not so bad if it happend once, as on the installation of the MSDN disks, but when it happens EVERY TIME that I open MSDN or VS2008, that makes me wonder.Especially when I just closed VS2008 and opened it again five minutes later.

The latest "update" according to the MSDN opener took not only a few minutes but approx. 20 minutes, although I did nothing to change anything since the last time I opened it.Is there any way to disable this constant updating of nothing?

Once more back to the GC issues.Does anyone have a simple to use class, so that at my will I can issue a simple call to a method to clear anything and everything unused from the GC box, short of having to close my application and reopening it?I mean, would it be to much to ask for a simple command that allows us to do this, without having to "imrpove on the MS developers years of efforts" by our own non standardized methods?

What I would like to see implemented in VS.NET would be a simple thing for the boys and girls at Mr. Gates command, to add the following

....GC.ClearAllDead

When called, it guarantees to clean the GC, empty all unused addresses and simply Dispose and Finalize everything at our will, and not leave this sometimes time and security critical part to the will of a users sometimes slow and willful PC.

Everyone knows how easy it is, and common to date that you load a webpage with some flash or adobe files and your computer starts sounding like a spaceship ready for relaunch.Quite obviously, something is running up your CPU and memory usage, and doing things you did not ask it to do when going to read your blog pages for example.Often I have experienced this, and still do on a daily basis, and I sweat every time I think of the possibility any application starts accessing memory addresses to scope up whatever junk is left in memory.Coupled with Garbage Collection potentially leaving items in memory addresses until it wants to free this itself.Now what if someone sneaks a trojan of a new variant onto your system, and this constantly sniffs your RAM for new funny and useful code.

there went your UID/PWD combo to both online banking, blogs, GMAIL, hotmail and all other nice things you use. Consider yourself facebooked in a nasty way, and then tell me GC is all good and poses no risks.So, the addition of the simple GC cleaner above would have been, and should have been, in my oppinion, the first and foremost update to the .NET package before it even was released, thus making it easier and faster for new and old programmers to avoid this cause for (perhaps to be considered as) paranoia.With my background from security and time critical related work, I would still prefer to patch the holes before they become an issue, and I will continue to chose being paranoid and safe rather than leaving this potential hole open.

View 7 Replies

Vb6 Migration - Library Behaviour While Migrating From VB6 To .NET?

Nov 24, 2010

I have a VB6 application which i need to convert to VB.NET 3.5. The application uses a lot of Business objects libraries and some external libraries.I would like to know if these libraries would behave the same way when i move from VB to VB.net?Are there chances that things would break?

View 1 Replies

VS 2008 Modify The Form Behaviour?

May 12, 2009

I have a problem with form instantiation. This is what I want to achieve: I want to create forms with a toolstrip attached to them right from the moment these forms are instantiated. I have several ideas:

1. making custom Form Control

2. modifying the new method for forms

I'd like to focus on idea 2. I want to know if there's a way to alter the in-built New() method, so whenever the compiler instantiates a form, somehow when the constructor(New method) of each form is invoked, the compiler adds a toolstrip to the form.

View 5 Replies

IDE :: Inconsistent Error "Reference Required To Assembly Containing The Base Class?

Mar 3, 2009

I have a Visual Studio 2008 solution with project A referencing project B as a project reference. Project B references System.Data.Linq, but project A does not. Everything compiles and runs fine. I like this arrangement because avoiding a reference to System.Data.Linq in project A ensures that it uses project B methods instead of directly accessign System.Data.Linq methods, which I want to avoid.

View 3 Replies

Integer Arrays - User Enter In Big Integers Using - Two Parallel Arrays

Dec 10, 2009

My assignment is to have a user enter in big integers using what i think is two parallel arrays. I got this far but now im stuck. I think i need to actually convert the text box input into an array but i do not know how to do that. I am all over the place in this project.

'Created/ Revised by: Jessica Falcetta
'Cap 204 Final Project: Big Integer Project
'Project Purpose: To calculate large integers through parallel arrays

[CODE]...

View 5 Replies

Passing Arrays Through Fortran Dll From App Turning To Single Element Arrays?

Feb 2, 2010

I have a VB.net console app and I am opening a function in a dll written in fortran. I am passing 3 arrays through the function by reference. When they come back out the otherside they ahve all tunred to arrays of only one element And that element is 0.I read on the internet somewhere that when doing this kind of thing it is a good idea to only pass the first element of the array into the function.I tried changing my function declaration to accepting single elements rather than single dimensional arrays, and now the arrays are the same length before and after the function call, but they don't seem to be changing at all, so i'm not sure that this is working

View 1 Replies

Change The Default Behaviour Of Headers In A Datagrid?

Mar 4, 2009

I want to change the default behaviour of headers in a datagrid. By default, if the sum of all column's width is lower than datagrid's width, then background color appears on the header and I want to keep it just like header's color, as ListView does. I've attached an image to show you in a better way what I want.

View 3 Replies

Different Behaviour Of Offset For Seekorigin.end For Emulator And Device

Jun 30, 2010

I have a smartdevice program. In this program, I have the following statement: xxx=mstbinreader.BaseStream.Seek(offset, SeekOrigin.End) When this program is run for Windows Mobile 6 Professional emulator and Windows Mobile 6 Professional device, following is observed: When offset is zero, both emulator and device return 20,467,484

[Code]....

View 1 Replies

Disabling The Behaviour Of The ", ` , Etc Characters For A Textbox?

May 30, 2010

I want to filter the input of keys for a textbox and wonder if the behaviour of the merging of two characters can be disabled for a textbox? I have a code writen that I thought was ready but this behaviour messes up my integer input.

Sample: " + o = รถ

For numbers this does works different and not desirable for me: " + 9 = "9

View 8 Replies







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