.net

Does .NET Regex support global matching?

I haven't been able to find anything online regarding this. There's RegexOptions, but it doesn't have Global as one of its options. The inline modifiers list also doesn't mention global matching. In a nutshell, I've got a regex to parse something like --arga= "arg1" --argb ="arg2" into separate argument name/value pairs using thi...

LLBL Gen Predicate Filter

I am new to LLBLGen Pro and am checking for duplicate, I have the following SQL: SQL: select a.TopicId,atc.TopicCategoryId,a.Headline from article a inner join ArticleTopicCategory atc on atc.ArticleId = a.Id where a.TopicId = 'C0064FAE-093B-466E-8745-230534867D2F' and a.Headline = 'Test' and atc.TopicCategoryId in ('004D64F7-474C-48F9...

Copying files over network (requiring authentication)

Is there some way to authenticate as a local (not network) user in order to copy files over the network in .Net? net use is not an option, and I can't seem to get LogonUser to work. Any ideas? [Edit] Here is some code: public class UserImpersonator : IDisposable { private WindowsImpersonationContext _impersonationContext; p...

Mixing inheritance mapping strategies in NHibernate

I have a rather large inheritance hierarchy in which some of the subclasses add very little and others add quite a bit. I don't want to map the entire hierarchy using either "table per class hierarchy" or "table per subclass" due to the size and complexity of the hierarchy. Ideally I'd like to mix mapping strategies such that portions ...

Connection Pooling

I have the following code, If I use conn == null in finally do I still use connection pooling? I know it is a good practice to close your connection but how about disposing the whole connection object? public void ExecuteNonQuery(SqlCommand Cmd) { //========== Connection ==========// SqlConnection Conn = new Sql...

Which one gives you more advantages: Microsoft or SUN/Oracle certification?

Which one gives you more advantages: Microsoft or SUN/Oracle certification? If you don't mind, please relate your answer to your career (dev, sys-admin, dba), industry (finance, general consulting, business apps, software house), and location (where you live, does it influence your decision?) as well. One reason I asked this because I h...

Efficiency of the .NET garbage collector

OK here's the deal. There are some people who put their lives in the hands of .NET's garbage collector and some who simply wont trust it. I am one of those who partially trusts it, as long as it's not extremely performance critical (I know I know.. performance critical + .net not the favored combination), in which case I prefer to manua...

How to determine pixel color of System.Windows.Controls.Image?

I have an Image from (System.Windows.Controls.Image). This image is positioned on a main canvas. I want to determine the alpha channel value of the mouse cursor when I click on any portion of this image. When doing something like the following, I'm getting an exception. {"Value does not fall within the expected range."} System.Except...

Unit testing ASP.NET MVC 2 routes with areas bails out on AreaRegistration.RegisterAllAreas()

I'm unit testing my routes in ASP.NET MVC 2. I'm using MSTest and I'm using areas as well. [TestClass] public class RouteRegistrarTests { [ClassInitialize] public static void ClassInitialize(TestContext testContext) { RouteTable.Routes.Clear(); RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ...

Why C# is an open standard but .NET is not?

Why C# is an open standard but .NET is not? What is the point in this? Why Microsoft decide to open only some part of their .NET? ...

Inter Process communication: MFC server, .NET C# client

Hi guys, I have two MFC C++ desktop applications exchanging string commands using named pipes. All good and reliable. Now, I have to add clients that are written in .NET C# using SilverLight controls. I know how to do named pipes in C#. But my first attempt to mix those failed: cannot connect clients to running servers. Is there an...

A better UPDATE method in LINQ to SQL

The below is a typical, for me, Update method in L2S. I am still fairly new to a lot of this(L2S & business app development) but this just FEELs wrong. Like there MUST be a smarter way of doing this. Unfortunately, I am having trouble visualizing it and am hoping someone can provide an example or point me in the right direction. To t...

Setting the datasource of a WPF Grid

Hi, I'm very new to WPF, and am trying to set the datasource (which the WPF Grid doesn't have as a property) of my grid to take a List. Does anyone have any code examples of how to do this. I have googled it, but can't find any really good examples. (Oh, and can anyone suggest a good site for all round WPF Code examples?) Thanks ...

BackgroundWorker and foreach loop

I have to process a loop with backgroundworkers. Before I start a new loop iteration I need to wait until the provious backgroundworker has finished. A while loop inside my foreach loop with isbusy flag doesn's seem like a good idea to me. How should I design this loop so it waits for the bg-worker to end before iterating the loop p...

Monitor multiple folders using FileSystemWatcher

Whats the best way to monitor multiple folders (not subdirectories) using FileSystemWatcher in C#? ...

Detect actual size of HTML content in the WebBrowser control

Is there any way to detect the contents height/width in the WebBrowser control? I'd like to save the contents to an image but only at the size of the actual contents. Thank you in advance. ...

How do I design a web service (microsoft) that can be consumed by multiple end points?

My company is planning to implement a solution in multiple applications that will help to validate mailing addresses at the point of data entry. We're using UPS's Extended Address Validation (XAV) web service API to validate the addresses. Our current plan is to build a .NET web service that can be used to communicate between our appli...

Should I have different models and views for no user data than for some user data?

I'm just starting to learn asp.net mvc and I'm not sure what the right thing to do is. I have a user and a user has a collection of (0 or more) reminders. I have a controller for the user which gets the reminders for the currently logged in user from a reminder service. It populates a model which holds some information about the user ...

Form Processing ASP.NET

I am not a .net programmer, so please bare with me. I have created a website survey that is in the footer of our site. Obviously the footer is on every page within our site. There is a link in the footer that opens a very basic include via jQuery toggle. (form.aspx) Once the form is submitted it is sent to another page that is not us...

How to return dynamic CSS with ASP.NET MVC?

I need a solution that lets me accomplish the following: Returning CSS that is dynamically generated by an action method Choosing CSS file depending on request parameter or cookie Using a tool to combine and compress (minify) CSS I am currently considering why there is no CssResult in ASP.NET MVC, and whether there might be a reason...