.net-3.5

Do I really need to write this "SerializationHelper"?

I just wrote this SerializationHelper class, but I can't believe this is necessary! using System.IO; using System.Xml.Serialization; public static class SerializationHelper { public static string Serialize<T>(T obj) { var outStream = new StringWriter(); var ser = new XmlSerializer(typeof(T)); ser.Seria...

Getting the date of a .NET assembly

How can I retrieve the Created date from the current .NET assembly? I'd like to add some realy simple functionality where my app stops working one week after the build date of the main assembly. I already wrote the code that kills my app after a given date. I just need to programmatically retrieve the creation date from the assembly. ...

Refactoring advice/ideas needed

Hi all, I was looking for ideas on improving the following code static void Main(string[] args) { bool validInput1 = false; string input1 = string.Empty; bool validInput2 = false; string input2 = string.Empty; bool validFilePath = false; string filePath = string.Empty; try { Console.WriteLine("...

C# Returning object from Array leaves pointer to Array item

I have a List<T> and I do the following: var myObj = List[2]; //Return object at position 2 myObj.Name = "fred"; //If you look at List[2] its name has changed to fred I tried the following but it still updates the item in the List var newObj = new MyObj(); var myObj = List[2]; //Return object at position 2 newObj = myObj; newObj.N...

Using .NET 3.5 classes in .NET 2.0

Hello all, I would like to be able to use .NET 3.5 types in an application based on .NET 2.0. Basically we don't have deployed .NET 3.5 libraries in desktops but we need to use some classes from there. Any ideas how this is possible ? Thanks, Marios ...

how to Close a Class to accept only specific Typed Object

Hello Friends, I have this Class which is accepting a Dictionary<string,object> which is been invoked from different places in the code. Dictionary concept is making things untyped and difficult to figure out what to pass the class to function otherwise it throws run-time exception. As this Dictionary<string,object> is a contract defini...

How to wire up a progress indicator

I have a circular progress indicator. I'd like to add this progress bar to an application I'm working on but don't know how to wire it up correctly. In my app, I want to hit the "Process" button and have the progress bar displayed while the data is being processed. When the processing is complete, I want the progress bar to hide. I don...

Reference a .net 3.5 assembly in a Script Task in SSIS 2005?

I've got this to work using a very basic example(outlined below) and I want to see if other SOers have experience doing what I'm attempting...using a 3.5 framework assembly in a Script Task in SSIS 2005. I've basically followed the page found here... except I targeted the 3.5 framework while in Visual Studio 2008. Write/compile your c...

Are there any good software development "patterns" for memory intensive .net programs?

Basically I'm working on a program that processes a lot of large video and image files, and I'm struggling with the memory management side of it because I've never dealt with anything quite like this before. For instance, it stores all these images in a database, and loads a list of videos, and then you can switch between the videos an...

Silverlight 3 DataGrid - Rounded Corners

Is there an easy way to give rounded corners to the boundary of a DataGrid in Silverlight 3? Thanks a bunch! ...

Can an ASP.NET 2.0 Web site reference WCF Web Services?

Our company currently has a web site which is deployed in Windows 2000 OS, which means that we could only install .NET 2.0 on that machine. Upgrading the Webserver OS is out of the question, since this web server also hosts other web applications in our country. As also part of our IT's policy, for security reasons the web sites are not ...

Is a mapping library like AutoMapper available on the .NET Compact Framework 3.5?

Is anyone working on a .NET Compact Framework port of AutoMapper or are there any similar mapping libraries for the .NET Compact Framework? ...

Is it still necessary to overload the == to cater for its normal operation?

the reason I asked the question was because after reading the msdn advice on overloading this operator at the end of the page it mentioned: A common error in overloads of operator == is to use (a == b), (a == null), or (b == null) to check for reference equality. This instead results in a call to the overloaded operator ==, causing a...

Entity Framework + stored procedure with paging

I am using Entity Framework now and using a stored procedure to populate my entity. Where there is no problem with populating my entity, but when i trying to bind the result to a gridview control with "Enable Paging" set to true, it gives an error saying "The data source does not support server-side data paging." I am using stored proc...

show "Save as" window

How can i show a Save as window in asp.net and C#... This is similar to the one that opens for uploading but that window is the open file... I am not looking to save only one file...like Response.AddHeader("Content-Disposition", "attachment; filename=" + myfile.Name); can i make it ung ajax... please help... samples or suggestions....

Installing Entity Framework

Hi there, I'm currently using Entity Framework at my job, but I've recently try to get it on my personal computer but I still didn't find a way to get it. Sure, I've searched on google but not really find any exe and not any thread that explain that. Thanks to help me out! ** EDIT ** I've now access to System.Data.Entity. But I've no...

Do all versions of Windows 7 include version 3.5 of the .NET Framework?

Do all versions of Windows 7 include version 3.5 of the .NET Framework? ...

Entity data field validation and part data submission

I have an entity class that has 10 fields. I am using MS Validation Application block to mark all fields as mandatory (IsRequired). I am implementing a securiy feature in which during updation of the data, not all the fields in the entity class will have data. For example a few users can only view 5 fileds while others all 10 fields dur...

how to remove html comment tag before render in asp.net

i'm using some components. When page render, components generate html comment tags. if i'm using this component 10 times on one page, html comments inserted 10 times. How to remove html comment tag before render page? ...

ListView CustomDraw not working on 64 bit Platforms

I am not sure if anyone can help with this, but I inhertied this code and I have no idea what the issue is nor am I familiar with the WndProc method. The area that is not running is the "' check for custom draw message" section. I need it to run the ProcessListCustomDraw(m) method so some thumbnails are generated. I beleive the origianl ...