.net-3.5

Using TimeZones on website using ASP.Net 3.5 / SQL Server 2005

I am trying to determine, how I should implement local time in a web-app. All users are logged in, there are no anonymous users. They will need to see all time-values in their local time. Is this how it should be done? All DateTime values are saved as UTC-time in database Each user has a UTC-Offset value stored in his profile When dis...

Garbage Collection on one object, C#

I need to dispose of an object so it can release everything it owns, but it doesn't implement the IDisposable so I can't use it in a using block. How can I make the garbage collector collect it? ...

Best Practice - Removing item from generic collection in C#

I'm using C# in Visual Studio 2008 with .NET 3.5. I have a generic dictionary that maps types of events to a generic list of subscribers. A subscriber can be subscribed to more than one event. private static Dictionary<EventType, List<ISubscriber>> _subscriptions; To remove a subscriber from the subscription list, I can use either o...

Inner Transactionscope error: "Communication with the underlying transaction manager has failed"

I am not sure I am doing any of this correctly. Is it because I am opening two connections? I am closing them regardless of errors. I did try putting in some inner transaction scopes and setting the second one to RequiresNew. The two methods are independent of each other, however, if one fails I need them both to rollback. I may have to ...

Dynamic event handler for the ListView ?

Hello everybody, It must be my special luck that today I stack with another problem and for second time coming here for help. And I really need help on this one. I have a listView control on which i have a button control. I am trying to add event handler to this button, I googled a lot before coming to here, but examples i found either ...

Is it possible to do ClickOnce Deployment with Apache?

Can I publish a winforms application using ClickOnce Deployment to an apache server? When attempting to publish to an Apache Server I get this error: Failed to connect to 'http://10.200.0.80:8081/WinSync/' with the following error: Unable to open the Web site 'http://10.200.0.80:8081/WinSync/'. To access Web sites on the l...

Data Access Layer Static or Instance based?

My current application is using an instance based data access layer. I instantiate the layer with the connection string. I then call a method that will do some sort of command. For example there is a method that will fill a dataset. Basically, I pass the stored procedure and any SQL parameters and get back a dataset. Is it better to have...

How can I change the address of a WCF service reference?

I have an application which is used internally and uses WCF for communication between client and server portions, however it will soon need deploying to sites where server names are different. The WCF services are hosted as a Windows service using the netTcp binding. At the moment, the addresses of the services are specified using the Ad...

Acessing the backing field in an auto property

Is there any way to access the backing field for a property in order to do validation, change tracking etc.? Is something like the following possible? If not is there any plans to have it in .NET 4 / C# 4? public string Name { get; set { if (value != <Keyword>) { RaiseEvent(); } <...

IIS7 url rewrite w/ ASP.Net 3.5 SP1 + asp:Login Form does not work

Hi everyone This question was kind of touched before but not the answer I was looking for. I am using the IIS7 URL Rewrite module to rewrite my pages, and now my asp.net login form does not work!!! On my master page I have this (ASP.Net 3.5 SP1 feature)... if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]))...

WCF FaultContract and where to put Fault Class (creating Multiple Services that use one FaultContract)

I am fairly new to WCF and have created a few services, so I have some experience with WCF. I want to create multiple services that can use a single FaultContract. I have noticed that the Fault type needs to be in the same project to make use of the [DataContract] and member attributes. Is this true or is there something I can do to add ...

Common Columns in ADO.NET Entities

Is there a way to extract common columns from various tables into a single base class in the ADO.NET Entity Framework when using the EDMX designer? For instance, every single table in my database has a "LastUpdatedBy" and "LastUpdatedDate" column that is necessary for auditing purposes. I would like to set these values automatically in...

Adding a reference to a lookup table in ADO.NET Data Services

I’m attempting to use ADO.NET Data Services to update my database. Tables: Person( PK PersonId; FK EntityRootId) EntityRoot( PK EntityRootId, FK EntityTypeId) EntityTypes( PK EntityTypeId) I’m trying to create an EntityRoot (unfortunate name since it may be confused with Entity Framework’s Entity. EntityRoot is in my domain) and ad...

How do I pass a property changed event to an ancestor?

I'm sure I am missing some of the basics here so please bear with me. I have a two objects, a SalesOrder and a SalesOrderLineItem. The lineitems are kept in an Observablecollection<SalesOrderLineItem> of SalesOrder, and if I add line items my databound listView knows about the new items. Now where I am having a problem is here: The Sal...

Getting a value out of a datagrid

I have a datagrid that I need to get a value out of after it has been populated. I'd prefer it not be dynamic (no clicking). The datagrids final product is a set of headers and one row Header1| Header2| Header3 Value1 | Value1 | Value1 I'd like to be able to get any value regardless of its position but right now I only need to ge...

windows 7 don't include .net 3.5 why?

i set up windows 7 two days ago. But i downloaded .net framework 3.5 . i think windows 7 included .net 3.5 ...

WCF Serialization with object inheritance?

I have two objects, one is in our enterprise level and another in in our service level. The service object is inheriting from the enterprise. Here is a quick example: [DataContract] public class EnterpriseObject{ [DataMember] int ID{get; set;} string InternalUse{get; set;} } [DataContract] public class ServiceObject: En...

Application with no references to Office requiring Office 12 (2007) in GAC for ClickOnce

I have a situation where I'm trying to deploy an application update via ClickOnce to many users, but on some it's failing with an error saying that they need Office 12.0.0.0 in their GAC. This happened after I installed Office 2007, so I uninstalled 2007 and reinstalled Office 2003, then re-built/re-published the app. Fixed it for so...

Opening a file's Shadow Copy if the current copy is in use

I'm trying to backup files on a server, but some of them are in use and cannot be opened. Instead, I'd like to open their shadow copy if the current copy is in use. How can I do this? For reference, I'm using C# .net 3.5. ...

WCF Impersonation and SQL trusted connections?

We have a service that is hosted under IIS7. The connection string for the SQL server is set to Trusted. In order for the authentication to happen I need to setup impersonation on the service and have the client initiate an impersonated connection. Is there a way to not have impersonation set and still allow the service to log into the...