Vb.net 2008 ContextMenuStrip logical error when running code

Greetings,

I have a connectmenustrip item that when clicked runs the following code
(see below)

Now if the event is called by the button i.e. cmdDeleteingBooking.Click the
linq query returns the appropriate value.

However when called by cntMnuCancelBookingItem.Click is returns 0 even if a
checkbox is of 'TRUE' value.

Debugging shows the code runs exactly the same code (which loops around rows 
in a datagridview checking if the checkbox has been checked).

Could someone explain the reasoning why the same code would return different 
results?


Private Sub cmdDeleteingBooking_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles cmdDeleteingBooking.Click,
cntMnuCancelBookingItem.Click

        MessageBox.Show("In here")

        'Linq statement to count number of rows where
        Dim bookingsSelectedDeletion As Integer = (From bookings In
dgvBookings.Rows _
                               Select bookings _
                               Where CType(DirectCast(bookings,
DataGridViewRow).Cells("selectColumn").FormattedValue, Boolean) =
True).Count

        MessageBox.Show("Number is " & bookingsSelectedDeletion.ToString)

End sub


Thanks
Rob



0
Rob
3/17/2010 7:25:46 PM
dotnet.languages.vb 830 articles. 0 followers. Follow

0 Replies
990 Views

Similar Articles

[PageSpeed] 11

Reply:

Similar Artilces:

recieved error message 0x8DE00006
I cannot get Outlook to send a mass mailer out to business emails. Is ther a max amount that I can send too? I just keep getting this error message and then I go to look it up and there is not solution. Please help!? I have about 375 emails addresses in a distribution list. I just can't seem to send it out. This is most probably an issue with your ISP. They put a quota on how many emails you can send out at a single time. It is a control put in place to restrict Spam. Call your ISP for info -- Peter Please Reply to Newsgroup for the benefit of others Requests fo...

"Application has failed to start..." error message with VS2005 on new machine
VC++ MFC Project working absolutely fine on one machine Installed Visual Studio on a new portable and copied the project and all the settings over, done a complete rebuild which worked fine but now get an error message "The application has failed to start becuase the application configuration is incorrect. Reinstalling the application may fix this problem" Have tried reinsalling (but I dont think this is relevant as I am working with VStudio) the message pops up a couple of times but then the program runs OK Does anyone know what this means and how to find out what is missin...

MS Office 2008 home version with Pro for entourage
Hello and thanks for any help you can provide. I have MS Office 2008 Home & Student edition. I want to install only word, excel and powerpoint and then separately install Entourage 2008 Pro (as provided by my hosted exchange co.) in order to connect to my exchange server. I have done this before and remember some convoluted errors but it eventually worked. My latest attempt did not. Has there been a change to prevent this from working? ...

All macros failing part way through with different error messages
All the macros I have in various workbooks are failing - usually part-way through - with different error messages each time. When I check the debugger and try to edit the text, there seems no reason why there should be a problem. The macro has so far stopped on instructions to : - open a workbook - select a worksheet - paste a column in a different place Several times the macro has just stopped running without completing and without showing an error message. I cannot run a host of urgent daily reports without using the macros. Please help! NO way to help unless you tell us exactly...

Cannot show, import, export userform: error &H80004005 / component is not corretly installed
Please, help me! I can not find where is the the information I need. My problem is: I had Windows 2000 and Office 2000. Now they installed Windows XP and Office 2000 (serv.pack 3). And my forms do not work anymore! The error message says nothing useful, only: 1) the component is not corretly installed (ok! but it's a common form with only normal windows common buttons and labels, not a single userparty creative control) 2) error: &H80004005 -2147467259 3) memory insuficient (ahah, at 512 Mb, only Excel running... ) 4) can not set OleObjectBlob property But if I try to open the...

converting tabular structures in a Word document into an actual table or reading data from the tabular structures using VBA code
I have a macro which can read the last cell/column of all tables in a Word 2003/2007 document and store the data in an MS-Access table. But, some Word documents have the data in structures like a table format but are not actually tables. The structure looks like a table, but the table borders are actually line connectors. These documents were created by a software(VeryPDF PDF to Word converter) which converted the PDF documents(the original format these documents were) into Word documents. 1. Is there a way I can convert/replace the tabular structures with actual tables in Word so t...

Distribution Files for MFC in VS .net 2003
I have an app that was developed under Visual Studio VC++ 6.0 & MFC and deployed at our customer site. I have since installed Visual Studio .NET 2003 and rebuilt the application under the new development environment. I wanted to do a quick test of the executable and copied it up to a test machine and tried to run it. I got a series of "unable to find xxx.dll" errors. I realized that none of the new DLLs were installed on the test machine. Does anyone have a pointer to a good document on what distribution files are required? I know about the obvious ones like MFC71.DLL...

VLookup in VBA giving error message
Hi, I'm having trouble making the vlookup function work in VBA. the values that are used are all dates, I don't know if that makes a difference. Worksheets("sheet1").range("a1").value = application.WorksheetFunction. _ Vlookup(Range("c1"), range("a:a"), 2) this gives me a run-time error '1004' Unable to get the vlookup property of the Worksheet function class so i tried this: Worksheets("sheet1").range("a1").value = application.Vlookup(Range("c1"), _ range("a:a"), 2) but this gives me a #REF ...

Exchange Connector Wizard error
I received this error while trying to run this wizard for a generic CRM user(what role does it have to have?) that would accept all email directly to CRM. I ran it on a client computer (was this wrong?) Here is the error, anyway. "Failed to initialize the rule management subsystem." What is the correct procedure to run this wizard? I did not find it anywhere. Thanks! ...

how do i change tick marks of excel graph from vb.net
I'm trying to change using VB.NET the tick marks from their default outside position and place them inside the graph. How can this be done? ...

Insert,Update Data in sage (MS Access Linked tables) using Vb.net form
Hi folks, I am developing application using vb.net which requires integration with SAGE LINE 50 (Accounting software ) V11... The data which SAGE is using is MC ACCESS 2003 database... with linked tables in it... Now I Have developed the Sage connection using ODBC which works fine when reading the record but cannot Add or Update record into the Linked tables.... When i debug the program the error is at the line where it has... <br> MyodbcCommand.ExecutenonQuery() <br> Can anybody Help ????? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/acce...

Vb.net 2008 ContextMenuStrip logical error when running code
Greetings, I have a connectmenustrip item that when clicked runs the following code (see below) Now if the event is called by the button i.e. cmdDeleteingBooking.Click the linq query returns the appropriate value. However when called by cntMnuCancelBookingItem.Click is returns 0 even if a checkbox is of 'TRUE' value. Debugging shows the code runs exactly the same code (which loops around rows in a datagridview checking if the checkbox has been checked). Could someone explain the reasoning why the same code would return different results? Private Sub cmdDelete...

RMS Status Codes
Just wondering if anyone has a list of what the RMS Batch.Status codes 0-15 mean? I can't find them defined anywhere. I'm specifically looking at how to identify Blind Closes so I don't count them in totals until they'e been closed. Thanks! -Zim There is a Knowledge Base Article that covers the different Batch Status codes from 0 - 31. Just search for 'batch status codes' -- Robert Armstrong RMS Systems Inc. www.retail-pos.com "Zim" <Zim@discussions.microsoft.com> wrote in message news:C72515DB-AD45-4C7D-B8DE-0A18E4A6D0D0@micr...

Excel worksheet with VBE codes don't work elsewhere
Hi, Some of my excel worksheets with embedded controls and VBA codes don' work when I open it on another PC. Is there another way to make i work? Thx -- lazybea ----------------------------------------------------------------------- lazybear's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3519 View this thread: http://www.excelforum.com/showthread.php?threadid=54955 Specifically what problems are you having? Saying "don't work" means absolutely nothing. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC ww...

js error in ie8
Hi, i am opening a popup window in ie8, the popup is load with loaded with one url and some javascript classes are intialized and able to call the member functions are from page and then i am re-directing the page the another url and the js classes are reinitialized. when i try to call the member function of the js class in the re-directed page, ie8 throws js error as "Unexpected call to method or property access". When debug the code, i found that the class is properly initialized and able to access the member variables of the class. i am getting problem only ...

Metadata Cache Error 04-14-04
When trying to "Go Offline" after synchronization completes I receive the: "Metadata Cache Error" No Entity Anyone experience/solve this issue? Hi, You may have replication setup issue on your SQL server, I suggest you to go through this article : http://mbs.microsoft.com/TechKnowledge/techknowledge.asp?print=true&id=33588&code=7842 If this is OK, you may test the following manipulation : Open SQL Enterprise Manager; go to Start select All Programs and then Microsoft SQL Server. Expand Microsoft SQL Servers, expand SQL Server Group, expand your Microsoft CR...

Need code snippet to read offline PST file
Hi friends, I have a PST file in my local hard disk and have requirement to read PST file and parse through all folders and then each message item in all folders and then segregate them to different folders based on subject line. Please kindly send the code for the above requirement. Thanks & Regards Ramesh -- ramserp You're going to have to write your own code. Do you know anything about Outlook programming at all? You can start out by looking at information and code samples at www.outlookcode.com. -- Ken Slovak [MVP - Outlook] http://www.slo...

OL2003 (Exchange) and OE6 running in the same PC
We are currently upgrading our OS from W98SE to WinXP. Our VP is using Netscape v4.67 with dial-up to access his personal email from the ISP and Novell Groupwise for his internal corporate email. With the new WinXP, he will be authenticate to Active Directory and using Exchange 2003 (Outlook 2003) for corporate email. (Yep, no more Groupwise!!) I want to move him away from Netscape to OE6 (built-in with XP pro). During my test in the lab, for some reasons I can't have OE6 and OL2003 running at the same time. (I can launch either one but not both at the same time) He wants OE6 as his...

Index and Match Function in VB
A few days ago, I did receive very good help from Max and Dave to achieve the following formula, =IF(B5="Synth",INDEX(AUTOS!$K$10:$K$500,MATCH(1,(Autos!$F$10:$F$500='ID'!D5)*(Autos!$G$10:$G$400='ID'!$R$2)*(AUTOS!$I$10:$I$400="C"),0))-INDEX(AUTOS!$K$10:$K$500,MATCH(1,(AUTOS!$F$10:$F$500='ID'!D5)*(AUTOS!$G$10:$G$400='ID'!$R$2)*(AUTOS!$I$10:$I$400="P"),0))+$R$2-$R$5,VLOOKUP(D5,$P$4:$R$8,3)-$R$5) Basically I was looking to retrieve data based on multiple criteria and the formula is working just fine. I now want to also be able to def...

Help! Problem Referencing Excel 2003 in VB.NET
I am using Visual Studio 2008 Express Edition to develop some VB.NET code that manipulates Excel files. I am developing on a Vista/Excel 2007 machine, but I need the code to work on an XP/2003 machine as well. I initially set a reference to the Microsoft Excel 12.0 Object Library and imported the Microsoft.Office.Interop.Excel namespace. This works great on the VIsta/Excel 2007 machine, but it does not work on 2003, which needs the 11.0 library. I get an error that says "Unhandled Exception . . . Could not file or assembly 'Microsoft.Office.Interop.Excel, Version 12.0.0....

Label Error with image?
Hi, We are trying to print a label for jewelry, the only issue we seem to have is that when an image is put into the label designer the image is the right dimensions but instead of being an image it is a box with red lines cris-crossing with the word 'ERROR' displayed in the center. This all happens before printing, although when we try to print there is no image. So what is it that we are doing wrong to not have an image displayed in the Label designer of RMS PO Manager. Any help[ would be greatly appreciated! Thanks ___________________ Dave Dave, In Label Designer, you have ...

Frx Susbcript 9 error
I am running a consolidated Income Statement in FRx and I get an Error 9 when it hits this one company. It consolidates 5 different companies, one that is translated. I just can;t figure it out. I have a very similar Balance Sheet that runs just fine. I have tried everything, change the output names, etc. I can run the report if I just select that one company but when I run the total company it won't run, it stops with the error. I am using row linking and currency translation. I can run the report for all companies individually. I just don't get it. I have gone through the various kb...

error on install to pocket pc
"window\mny2day.dll" is in use or is in ROM. IFthe file is not in ROM, please close the application using the file. I do not understand what file could be using the same application or how to check the ROM. ...

Sql Agent Error
After installing CRM we are receiving the following error. "An error occurred when attempting to set the SQLSERVERAGENT service to AutoStart: System.ComponentModel.Win32Exception: The specified service does not exist as an installed service at Microsoft.Crm.Setup.Common.Utility.ServiceUtility.SetServiceToAutoStart(String serviceName, String machineName) at Microsoft.Crm.Setup.Server.ServiceRunningValidator.AutoStartLocalService(String serviceName, TimeSpan waitTimeForStart) We have CRM on a SBS 2003 machine and SQL EE 2000 on a W2K3 machine. Both are DCs the SBS holds all FS...

Interesting Solver problem (Solver encounters an error)
Here's an interesting problem, I wonder if anyone has any thoughts o this. Recognize that my real problem is very complex (severa intermediate calculation including some iterative steps), but th problem I'm having seems similar (conceptually anyway) to this simpl problem. Given a data set: x,y 10,3.9 8,3.2 7,2.8 6,2.2 5,1.4 4.5,0.8 4,0.01 3.8,-0.4 3.6,-1 3.5,-1.4 3.4,-1.8 3.3,-2.4 3.2,-3.2 3.1,-4.6 3.05,-6 One could look at the data and say, "that looks like the curve y=ln(x) but with a different asymptote other than the y-axis and possibly scaling factor." So we choos...