I'm sure all us C# guys, at some point or another, have looked 'over the fence' with envy at all those juicy Java libraries. In my case, recently I needed to export and import some Excel files, and found that there aren't really any good C# libraries for it.
This snippet of code shows how to use the generic System.Data.Common types to connect to any database, using a string to define which database provider you want to use. The magic happens with the 'Activator.CreateInstance' below, where C# has the ability to create a class from a string.
Hi again,
When setting up scheduled tasks to run on an windows server, i've found it useful to wrap my executable with a batch file,
Here are some DHTML tricks i've been using to make the user experience a bit more keyboard-friendly. These are all asp.net specific, but general in nature.
Had an issue recently trying to figure out what application was holding a connection open on a SQL server, and here's the lowdown on tracing it down. Firstly, go into a query window and do the following:
sp_who select spid,hostname,hostprocess from master.dbo.sysprocesses
The 'sp_who' will list the open connections. Look through this list to find any where the ‘dbname’ column is the database you're interested in, and then look for the value in it’s SPID column. The 'sysprocesses' query will give you, for each SPID, the hostname and windows process id (‘hostprocess’) which you can then look up in the task manager on that particular computer.
I've recently been experimenting with C#'s delegates, and here is an example of
how they can be used for multithreading. I've used a ray tracer as a good example
of something that can be multithreaded easily.
I've discovered that the GZip compression built into C# (System.IO.Compression.GZipStream) doesn't really do that good a job at compressing data. I heard (cannot confirm) that MS had to tread lightly around some patents which results in pretty poor compression ratios. I needed to compress some data, and compress it well, as I had a whole bunch of data files from a reporting project totalling up to 5gigs. So the GZipStream wouldn't do.
I know, you'd think this would be simple, but i keep needing to refer to it:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
I likey…
http://rubyrags.com/products/2
Well, here's my first post. Mainly this is to test out Wordpress.
So - while you're here, check out my open source project:
http://rosters.rubyforge.org
