0

You receive a “The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect” exception when using NVarchar parameters with Sqlclient

Posted by Tim on August 26, 2010 in .NET Framework, SQL Server

The problem I got the following random error: You receive a “The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect” exception when using NVarchar parameters with Sqlclient The Solution Its a known bug with the .Net SqlClient Data Provider.   If you have a field in the database of type nvarchar(max) [...]

Tags: , ,

 
1

Open XML – OLE Automation Date Issues

Posted by Tim on July 26, 2010 in .NET Framework, C#

If you are exporting a date from C# to Excel using 2007, you probably will use the following: Math.Round(DateTime.Now.ToOADate(), 12).ToString() This exports the date as a OLE Automation date recognized by Excel 2007. How ever, in Excel 2010 this was causing issues, every time I exported to Excel 2010, it said that it has to [...]

Tags: , , ,

 
0

EF Strongly Typed ObjectQuery.Include

Posted by Tim on July 13, 2010 in .NET Framework, C#

The problem that I faced was having to put up with “hard coded” strings in the ObjectQuery.Include function to load related objects through POCO objects in the Entity Framework. This faced challenges when I renamed columns in the Model which caused a run-time error when recompiling and re-starting the application. Thanks to David Kiff, we [...]

Tags: ,

 
0

Fixing the EF Tracing and Caching Provider Wrapper Issue

Posted by Tim on July 9, 2010 in .NET Framework, C#

If you have been using the Tracing and Caching Provider Wrappers for the ADO.NET Entity Framework 4.0, you might of come across this error message when creating POCO objects, adding them to a Data Context and commiting them to the database using the Caching Wrapper: [NotImplementedException: The method or operation is not implemented.] EFCachingProvider.EFCachingDataReaderCacheWriter.GetName(Int32 ordinal) [...]

Tags: , ,

 
1

Detect when a session has ended ASP.NET

Posted by Tim on June 30, 2010 in .NET Framework, ASP.NET, Visual Basic

A problem that I have had in the past is trying to find out when a session has expired within ASP.NET and how to deal with the expired session.   One solution is to add the following code into the Page_Init event.   You can add this event into a class that inherits the Page class so [...]

Tags: ,

 
0

Random number of items from a Generic List extension method

Posted by Tim on June 13, 2010 in .NET Framework, C#

Here is a code snippet  for returning N number of items from a generic list using a extension method.  This requires .NET 3.5. public static class Extensions     {         /// <summary>         /// method for returning N number of random items from a generic list     [...]

Tags: ,

 
0

Could not load file or assembly ‘NameOfAssemblyGoesHere’

Posted by Tim on June 11, 2010 in .NET Framework, ASP.NET

Encounted the following error: Could not load file or assembly ‘NameOfAssemblyGoesHere’ or one of its dependencies. An attempt was made to load a program with an incorrect format. The problem happened when deploying a web application to a 64bit server where all the required DLL’s where marked as running only on a 32bit system.   You [...]

Tags: ,

 
0

Change username in ASP.NET Membership Provider

Posted by Tim on May 31, 2010 in .NET Framework, ASP.NET

Found a great article here about the process of changing the username with the ASP.NET Membership Provider. Here is a summary of the process that I found best useful which is one of the comments: 1. Make sure New UserName is Unique 2. Update the aspnet_Users table directly 3. Execute to following code to change [...]

Tags: ,

 
0

IIS Wont start error 13 data is invalid

Posted by Tim on May 26, 2010 in .NET Framework, Windows Server

I got the following error when trying to figure out why I couldn’t start IIS 7 on Windows Server 2008 R2.    I tried to start the World Wide Web Publishing Service but its dependency Windows Activation Service wouldn’t start.   I got the following error in the Event Log: The Windows Process Activation Service service terminated [...]

Tags: ,

 
0

A way around page refreshes/back button problems with a simple concept

Posted by Tim on May 17, 2010 in .NET Framework, ASP.NET, News, Open Source, Uncategorized

The problem: You have a form in which the user fills out and clicks a “submit” button that validates their input, does some processing and output’s some results. The problem being the application needs to cater for page refreshes, back buttons and the case of the page being submitted more than once (latency/slow internet connection). [...]

Tags: , ,

Copyright © 2008-2010 Tim's CodeLab Blog All rights reserved.
Desk Mess Mirrored v1.7 theme from BuyNowShop.com.