Thursday, January 17, 2008

Free Microsoft books.

I just found 3 free microsoft books that you can download as a PDF:

Microsoft Press

Once signed in, you can download Introducing LINQ, Introducing ASP.NET AJAX, and Introducing Silverlight 1.0

You can preview a couple of chapters, or download the whole book in PDF format.

Enjoy!

Friday, January 11, 2008

SSIS, AS400 and the System.Byte[]

So, I have an SSIS package that I'm wanting to create. When I use the ODBC connection (similar in the DTS), I can pull everything over fine. I have 2 fields, one is a Char(3) the other a Char(13) on the 400. I've made the exact table in my sql server db.

The problem is that if I use the ole for .net instead of odbc, I get the following Error when I switch the provider in the SSIS package:




I'm using the IBMDA400 OLEdb\IBM DB2 UDB for iSeries when I get the error

I'm not having this problem with any other of my SSIS packages... wierd.

Monday, December 31, 2007

objectdisposedexception - Safe handle has been closed Pt 3

I don't know if this will help in the error, but I did come across a reference to add to the app.config of your app to set the following flag. This may mask other errors, and I haven't tested it out yet. But it is one more option to add:

legacyunhandledexceptionpolicy enabled="1"

Under the config section of the app.config.

objectdisposedexception - Safe handle has been closed Pt. 2

In doing some more research, I found this bit from a Microsoft Feedback page:


The issue reported to us occurs not because the iDB2NamedEvent class calls the Handle property, but because it calls it while the WaitHandle is registered with the ThreadPool through ThreadPool.RegisterWaitForSingleObject. This is not a valid operation.

The workaround is either to avoid closing the handle manually in the finalizer for the iDB2NamedEvent class (the runtime will take care of that anyway), or unregister the WaitHandle from the ThreadPool before closing the handle. Option 1 is probably preferable.


It sounds like this is the only case that you should not call the disposed method. Instead, let program clean it up on it's own. Yuck.

Friday, December 28, 2007

objectdisposedexception - Safe handle has been closed

It's been a while since I've posted, and here is my current issue. I'm writting a call from an asp.net webservice to an IBM as/400 storedproc via IBM's "IBM DB2 UDB for iSeries .NET Provider"

It works great! I have a stored procedure on the iSeries system that calls an internal program. I can make the call. However, when my project stops or closes down, I get an ObjectDisposedException, "Safe handle has been closed" I've seen a few posts here and there about it, and finally stumbled across this bit from IBM:

SE22506 - CA400EXP-IDB2DATA .NET PROVIDER WITH .NET FRAMEWORK 2.0
At least they have a patch. Though, I don't know how long it will take our team to get the patch installed, tested and move to production. Well, hopefully it won't take long.

But in any case, at least now I have a path to go down. And according to their records it will work on V5R2M0, V5R3M0, and V5R4M0. We'll see I guess.

If anyone has some other method for working around this error, I'd love to hear about it.

Friday, October 12, 2007

DataFormatString Time and Date

So you have abound control, and want to only display the time portion? Or just the Date? Well, to start, that bound control must have HtmlEncode="false". Now, the only warning that I've seen on it, is that it maybe subject to an injection attack. And if you're worried about that, then you should probably use a templateitem instead.

Once you have the HtmlEncode="false" assigned to the bound item, use the DataFormatString="{0:t}" to get just the short time, and DataFormatString="{0:d}" to get a short date. You should be able to use any number of the formats in here to format it anyway you like. It took me some time to find these seemingly steps to get just the time on a datagrid column.

Mike

Friday, July 6, 2007

VMWare, Vista and VPNs part 2 (over wireless)

Note: This is over a wireless connection, over a wired connection, things work just fine.

I did it! I finally got settings worked out to be able to VPN into work from home with my Virtual Machine (running XP) on my Vista system.

First, I had to set the Virtual Machine to use NAT connections, not Bridged.

Second, I had to go into the Network Connections, and make sure that the VMWare Network Adapters to a Private Network, NOT Public.

Third, I had to connect to the VPN via Vista, NOT inside of the VM (as I previously had to do when I was hard wired in)

Fourth, I had to use Microsoft's Firewall Client for ISA server in Vista (the host machine) in order to get Internet access (though, this step will depend on your network).

Fifth, I also had to set the proxy server directly in IE inside the VM so that I can get internet access via the VM.

Enjoy!

Mike