Monday, February 16, 2009

bulk insert access denied problem

You may get this error when trying to use the bulk insert operator in SQL server 2005:

Cannot bulk load because the file "\\maykov100\public\blogcatalog.txt" could not be opened. Operating system error code 5(Access is denied.).

As it turns out, SQL server tries to use your credential to access the file to bulk import (impersonation). In a situation, where you access SQL server remotely (ie from a SQL Management Studio running on your machine), your credentials can't be retranslated. Possible ways to solve this problem:

  • Use BCP from your local machine
  • Run the SQL managements studio directly on a SQL machine
  • Modify your company's active directory to allow impresonalizati0n

Wednesday, February 4, 2009

Visual Studio, Remote Debugging, DOM problems, etc

I think, this is familiar to any Windows developer: you start a remote debug monitor, point your VS to it and all you get is some network error message box. Today, I finally solved this mystery. Make sure that you can access the machine running Visual Studio from the machine where the program is running by its DNS name. In my case, I just got assigned a new IP address from DHCP and the remote machine had a wrong IP for my machine. Once I fixed this, remote debugging started working again.

C# HttpListener: HttpListenerException: The I/O operation has been aborted because of either a thread exit or an application request

In this blog, I'm going to start focusing more on small details of C# programming. With this said:

 

HttpListener is a great C# 2.0 class. It allows you to create web-servers without having to have an IIS server on your machine. This became possible since a while ago, IIS was divided into two parts: HTTP.SYS and proper IIS. HTTP.SYS is supplied with any machine running XP SP2 or Server 2003. HttpListener allows .net programs to use HTTP.sys

My program creates HTTPListener, calls Start and BeginGetContext methods. Then, the thread terminates. Whenever an HTTP request is received a delegate is called on a thread pool thread which call EndGetContext and generates HTTP request. It worked fine on Vista, but started throwing exceptions on Server 2003. After I made sure that the thread calling HTTPLIstener.Start didn't terminate, the exception went away.

I hope, this will be useful to some pure soul trying to debug.

Friday, December 26, 2008

Snow

Seattle area is not a snowy place. When a snow fells several times per year, usually it doesn't stick for longer than one or two days. This year, we're having an anomalously long period of snow. In the last week, we went through all phases of a typical Russian winter. It started with a heavy December snowfall on Thursday, then there was a January low temperature and a sunshine on Friday and Saturday. A February blizzard followed. Now, we're going through the early spring snow melting. We and other people in my neighborhood got a full advantage of snow activities. We went sledding, cross country skiing, built lots of snowmen. I even saw downhill skiers and snowboarders. Traffic, of course, was the mess. The lack of snowplows in Seattle manifested itself in a fact that they closed the steep road near my neighborhood. Some people kept using it since it was the only way to get to their house. Instead of plowing it, they put a policeman giving out warnings and tickets for driving on that road.

Here are some photos which I took:

Sledding hill:

IMG_2722

 

US Mail truck making it through the snow:

IMG_2727

The UPS truck got stuck and was abandoned for the night.

IMG_2736

An Igloo house which we built on our lawn.

IMG_2731

Monday, November 10, 2008

Very nice LiveJournal visualization

 

image

http://aqua.livejournal.ru/

 

BTW, all these д nonsense on the background is a porno spam in Russian language.

Monday, November 3, 2008

Politics

As we are getting closer to the unwinding of the current political conundrum, here is a video which may help you to make your decision. Here we go: GOP maverick