.net

Build order in CruiseControl.NET with project dependencies

In our .NET software development shop, we have CruiseControl.NET set up to build 28 projects, some of which are interdependent. Each project approximately represents a Visual Studio projects or Flex library paired with unit tests. What I'm annoyed at is that I haven't found a good way to ensure that projects build in an order represent...

Using a variable for table name in 'From' clause in SQL Server 2008

I have a UDF that queries data out of a table. The table, however, needs to be definable as a parameter. For example I can't have: Select * From [dbo].[TableA] I need something like: Select * From [dbo].[@TableName] The above line doesn't work, and also the UDF prohibits me from setting the query as a string and calling exec(). I can...

DevExpress vs. Telerik grids for ASP.NET web applications

I dropped the trial version of the DevExpress GridView in my ASP.NET project and found it to be very powerful, easy to setup, and flexible. However, I think it only does Default Paging and not Custom Paging (pulling down all of the records per page isntead of just the records of the page). I looked into see if I could figure out how to...

When C# compiler is written in C#, will one be able to modify it?

I am wondering about it in terms of whether one can implement some new functionality for convenience. Will this be possible, when it's out? C# 5.0: compiler as a service: http://www.matthewlefevre.com/blog/entry.php/c-40-and-c-50/368 ...

How can I determine if a value in a struct has been changed?

I have two structs of the same type, the fields are comprised of strings. One struct is a "current/changed" state, the other is an original state. Is there a simple way to determine if the fields have changed other than iterating through each field and comparing one-by-one? ...

Sorting by column name string

I have an observable collection. I want to use linq to sort it. I have the propertyname of the property I want to sort (as a string) for my type. What is the best/fastest way to do this? Different propertyname strings will be passed into the function ...

.NET: How to write a file with limited permissions for temporary data

I have a library I am using where the only way to pass in config data is by giving it a filename where it can go to read the data. I am writing another shared library to be used by all of our applications which consumes this, and so I need a way to store some data in a local temp folder, and then delete once I have called the shared lib...

How can I write clean code for a class that uses modular extension methods?

I'm trying to do something rather... unique, and maybe there's a far better way to do it but... I'm doing an inversion of control(ish) system that uses extension methods to enable/disable components of the class, so before I get into more detail and confuse you, lets look at some code! using TestComponents.CommunicationProtocols.RS232; ...

Build Action for large set of images?

I'm in Visual Studio 2008 and I have a project that loads lots of images. I want the images to be deployed to the local instance of the software running. The trouble is that I tried using the images as a resource, but there are apparently too many(200 to 300) because I get strange build errors like GDI+ exceptions and Out of Memory Exc...

.NET Regex and newline

Hi. I wanted to ask why .NET regex doesn't treat \n as end of line character? Sample code: string[] words = new string[] { "ab1", "ab2\n", "ab3\n\n", "ab4\r", "ab5\r\n", "ab6\n\r" }; Regex regex = new Regex("^[a-z0-9]+$"); foreach (var word in words) { Console.WriteLine("{0} - {1}", word, regex.IsMatch(word)); } And this is the r...

Determining with C# Whether a SQL Backup File is Password Protected

How would I go about using C# to programmatically determine whether a SQL Server 2000 backup file has been password protected? ...

How to detect variable *name* (not type) within a function (Why? For a custom ASP.Net databinding implementation)

So, let's say I have this code (VB.Net): Sub Main() dim xxx as string = "HELLO WORLD" DetectName(xxx) End Sub Public Sub (theVariable as string) dim output as string = "The Value: {0} was stored in the variable named: {1}." debug.writeline(string.format(output, theVariable, What Goes Here????)) End Sub Te output I want ...

assembly load error

I receive Could not load file or assembly 'DeployLX.Licensing.v3, Version=3.1.2000.0, Culture=neutral, PublicKeyToken=798276055709c98a' or one of its dependencies. One or more arguments are invalid (Exception from HRESULT: 0x80000003) InnerException: System.Runtime.InteropServices.COMException On some copiers of windo...

What tool do you use to model your domain objects?

I am looking for a tool that will let me model my domain as well as map exports of it to other formats. Is there anything good out there? ...

Free Access to DB2 via ODBC

Is there a free option to connect to DB2 via ODBC on within my .NET app? I believe the most common ways require a license: Data Direct $$$$ IBM Client Access Host Integration Server I just want to install an ODBC driver that I could access from a C# app. ...

How do facebook applications work?

Hi, Here's a little bit about my situation: I want to be able to retrieve a list of emails for the friends of a given user. Here is how I would like the process to go: A div box pops up with a login (used to log in to their facebook account, not my website's account system - that is separate) Then once the user has entered their face...

Passing an object to a .NET web service via PHP's SoapClient

My company publishes a set of .NET webservices available via SOAP. I need to tie my PHP application into these, but I'm bumping up against a problem that I can't find a solution for. One of the services I need to access has a signature of Advertiser CreateAdvertiser ( Advertiser advertiser ). How can I pass an instance of an object that...

How do you filter a collection of objects in a base class based on the type of the sub class created?

I wrote this example to help explain. As you can see I have an object hierarchy. I'd like to modify the GetFeatures() function to only return the features added by constructor of object type I instantiated. For example, BasicModel.GetFeatures(new LuxuryModel()) should only return the features "Leather Seats" and "Sunroof". I don't mind u...

Determine the size of Groove Workspaces programmatically?

Is there a trick in the Groove Web Services to find the size of a Groove Workspace, as displayed on the Properties dialog? Most of the other information shown here is available, but I can't find size. Thanks for the help.. ...

Execute code on assembly load

I'm working on wrapper for some huge unmanaged library. Almost every of it's functions can call some error handler deeply inside. The default error handler writes error to console and calls abort() function. This behavior is undesirable for managed library, so I want to replace the default error handler with my own which will just throw ...