September 2009 Entries

ReportViewer local - Add a line number to the .rdlc textbox

//Add a line number to the .rdlc textbox: use this formula =RowNumber(nothing) //ReportViewer Conditional Formatting of BorderStyle based on whether anything is in the report. =iif(CountRows()=0,"None","... =iif(CountRows()=0,"None","... =iif(CountRows()=0,"None","... //ReportViewer Conditional Formating and showing the Avg if there are rows in the report. =iif(CountRows()=0,"",(Avg(... & "%")) textbox: name: PageXofY ="Page " & Globals.PageNumber & " of ......

Posted On Sunday, September 13, 2009 7:03 PM | Comments (2)

Implement handlers for the DataGridView control's CellValidating and CellEndEdit events.

The CellValidating event handler is where you determine whether the value of a cell in the SchoolName column is empty. If the cell value fails validation, set the Cancel property of the System.Windows.Forms.DataGr... class to true. This causes the DataGridView control to prevent the cursor from leaving the cell. Set the ErrorText property on the row to an explanatory string. This displays an error icon with a ToolTip that contains the error text. In the CellEndEdit event ......

Posted On Sunday, September 13, 2009 6:53 PM | Comments (0)

Entity Framework and Join Tables.

I had a true join table (two foreign keys which, together, were a composite key in the join table). I followed the steps enumerated in Julie Lerman’s Blog Don't Be Iffy and got unexpected behavior. I was not only inserting new rows where they belonged, but was adding to one of the tables with the foreign key! Not good! Since she is the “go-to-Guru” I was baffled! Then I realized the issue, and used Julie’s Platinum Rule to solve the problem: “The Platinum Rule is that an object graph (for example ......

Posted On Tuesday, September 8, 2009 5:02 PM | Comments (0)

Error: conversion of a datetime2 data type to a datetime data type…

Using VS2008 and Entity Framework, the exact error message is: "The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.\r\nThe statement has been terminated." There are several causes for this rather generic (and not very intuitive) error message. I had changed some fields in the SQL 2008 database from non-nullable to nullable, and then asked the tool to “update model from database”. The error message appeared in that instance because one part of the ADO.NET ......

Posted On Sunday, September 6, 2009 5:01 PM | Comments (1)

How to force update of Intellisense without opening and closing a file in Visual Studio 2008?

In Visual Studio 2008, I periodically see the error in the status bar: ”Error updating JScript Intellisense, see Error list” HOWEVER, there are no errors about this in the Error list! And, the site compiles, runs, and publishes perfectly! Total annoyance! I believe this is an error caused by the inclusion of the JQuery library and some inability of the Intellisense parser to “play nice in the playground”. Okay, so what’s the [workaround]? You can force an update of Intellisense with the following ......

Posted On Sunday, September 6, 2009 5:00 PM | Comments (0)

…Session state can only be used when enableSessionState is set to true…

I am using VS2008 in a Vista Ultimate environment. Here is the complete error message: ”Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the “<configuration>\<... section in the application configuration.” NONE of that was the problem! ......

Posted On Sunday, September 6, 2009 5:00 PM | Comments (2)

Copyright © intermark

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski