.net

Are there existing data layers I can use for an application I'm building?

I'm writing a .NET application and the thought of implementing a data layer from scratch is icky to me. (By data layer I'm referring to the code that talks to the database, not the layer which abstracts the database access into domain objects [sometimes called the data access layer and used interchangeably with data layer].) I'd like ...

Modifying the Portable Extensible Metadata project

I would like to modify the Portable Extensible Metadata project, but there is no source code. I do have the extension starter kit but the PEM project does a lot more than the extension kit. Can someone help? ...

Regex repeated replace

Hi Is it possible to have a single but recurring regex.replace call? e.g. string dateText = "01\.02\\.2008"; string dateSeperators = @"\.|/|\\|-"; string result = Regex.Replace(dateText, dateSeperators, "."); // needs to be fixed. single call possible? The result should give "01.02.2008". Currrently i need 2 runs, first run the above...

Viewing XSD as code

When I open XSD files in Visual Studio, some of them open up as diagram representations, while some open up as code. How do I switch between the diagram view and code view? ...

Excel colours getting distorted when being copied from one template to another using VSTO(C#)

Hi, We are trying to generate an excel sheet using a template. Normally we would have done have a basic "Save As" to save the file but the file size came up to be too high. So, now we're working on copying the used range of the original workbook to a new workbook. The data is getting copied, along with the validations and formulae on u...

.NET asynchronous delegates and object instance members

In using .NET asynchronous delegates for the first time, I was surprised to empirically discover that when changing an instance member value (e.g. an int) in the asynch method (running in the new thread), the value of the instance member running in the original thread was also changed. I thought that when a new thread is created, instan...

Any issues working with TFS 2010 and where company has vs2008 and office 2003

I really wanted to know if people have found any compatibility issues working with TFS 2010 and projects in vs2008 in terms of source control, daily build, continuous integration, work item tracking, etc. I understand that we can connect to TFS 2010 from VS2008. We are planning to onboard to TFS, but really need to make a choice between...

.Net Entity Framework and Transactions

Hi, Being new to the EF, I'm really rather stuck on how to proceed with this set of issues. On the project I am currently working on, the entire site is heavily integrated with the EF model. At first, the access to the EF context was being controlled using an IOC bootstrapper. For operational reasons we were not able to use IOC. I remov...

Needed: A Windows Service That Executes Jobs from a Job Queue in a DB; Wanted: Example Code

Needed: A Windows Service That Executes Jobs from a Job Queue in a DB Wanted: Example Code, Guidance, or Best Practices for this type of Application Background: A user will click on an ashx link that will insert a row into the DB. I need my windows service to periodically poll for rows in this table, and it should execute a u...

How do I create an installer for a .NET winforms application so it doesn't need to install?

I'm responsible for an in-house application that is deployed as a ClickOnce application. We run into issues reasonably frequently when a developer runs the tool after a a several new versions have been published (due to new features, bug fixes or whatever) and the output of the tool no longer conforms to what the developer is expecting...

Get FieldInfo of a field that is to be assigned

Is there any way to get FieldInfo of a field in a function that is going to assign a value to that variable? See my example: class SomeClass{ MyType myObject = SomeOtherClass.MyFunction(); } class SomeOtherClass{ public static MyType MyFunction(){ //Get FieldInfo about myObject here } } Background: What I wa...

Executing Application inside an archive file without extraction

I want to compress and encrypt my whole application, maybe with Zip, 7z, Bz2, Tar, or any compression method, and using AES-128/256 as encryption algorithm for security purposes. Then create a launcher application which will handle the execution of the application and decryption of the archive. I already have an idea on how to achieve i...

Trouble Serializing Enum in .NET

I have an elementary stumper using serialization in an ASP.NET 2.0 application on a C# class containing an enum property. It's my understanding that serialization of enumerations is supported if they map to integers. So, I can't figure out why I'm having this problem serializing/deserializing my enum. My Code: [Serializable] public c...

Regex works differently on different computer

I'm writing a program which uses regex to match incoming data. The regex works on the computer I'm coding on, but it doesn't work on the client computer I'm testing on. It works on my computer in debug mode, release mode, and being run straight from the bin. What could possibly make a regex work differently? Regex: const string _patter...

Excel Add-In deployment problem

I built an Excel add-in with VSTO 2005 SE, which I deployed to a user base that is predominantly Office 2003-based, but also with several workstations that have Office 2007 installed on them. On the Office 2003-based workstations, the add-in works perfectly. Now because this add-in was created with the version of VSTO for Office 2003...

LINQ - Get all items in a List within a List?

Hey all, I'm currently working my way through the learning curve that is LINQ and I could really use some assistance. I don't know if what I want is possible, but if I had to wager, I bet it is. I currently have a list of objects called _tables and each of these objects has within it another list of objects exposed through the propert...

Traversing ASP.NET HTML Elements using LINQ

Guys, Assuming I have the following ASP.NET HTML Code: <html> <head><title>Test Page</title></head> <body id="bodyID"> <asp:Label runat="server" id="lbl1" text="First Name:" /> <asp:TextBox runat="server" id="txt1" /><br /> <asp:Label runat="server" id="lbl2" text="Last Name:" /> <asp:TextBox runa...

ADO.NET EF 4 vs. DataSets (of any kind)

Hello, I've been reading updates on Data Sets vs. Other ORM's like ADO.NET Entity Framework, but a lot of them refer to the older version, so with EF 4 as an option today, what is people's opinion for data sets vs. EF 4, which is better, worse? I like EF 4 because: The designer finally works well. The variation of model options (POC...

How to hook up a mock proxy server?

My sharepoint webpart is throwing an error on my client's environment when calling HttpWebRequest.GetRequestStream (and he's using a proxy server). The error is "unable to connect to the remote server." What's the best way to reproduce this scenario (hooking up a mock proxy) on my end so that my requests go out through the proxy server...

WPF PasswordBox validation

Hi, I'm trying to add some validation rules to 2 PasswordBoxes. Both must have more than 5 characters and, both passwords must match. I'm not currently using MVVM. I figure I could check the password on the PasswordChanged event but I can't get the Invalid state to toggle on the boxes. Does anyone have examples of something like th...