.net-3.5

how to upgrade code to a new version of third party control

Hi Guys, I have a web application in asp.net 3.5 where i have been using some third party controls i.e. Devexpresv9.2 and on the pages where i am using these controls i normally has to call the register tag on the page markup like for ex: <%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d...

gzipstream.copyto alternate and easy way in .net 3.5

hi in this code in .net 4 i used copyto method of gzipstream System.IO.MemoryStream ms = new System.IO.MemoryStream(byteArray); GZipStream DecompressOut = new GZipStream(ms, System.IO.Compression.CompressionMode.Decompress); MemoryStream outmem = new MemoryStream(); DecompressOut.copyto(outmem); ...

Calculating Timespan using asp.net

Hi I would like to use asp.net c# to calculate the timespan for when a file was uploaded. Example, if i uploaded a file two weeks ago my text will say 'uploaded 2 weeks ago' or if i have upload a file 4 month's ago my text will say 'uploaded 4 months ago' Can anyone please give me some tips on how i can go about this. Thanks ...

Xml Serialization Attribute and Text

I have a simple Xml Node that I need to recreate <Division ID="123">Division Name</Division> But when I create the class as public class Division { [XmlAttribute] public string Id { get; set; } [XmlText] public string Description { get; set; } } I get <Division>Division Name</Division> The Id vanishes. How ...

WCF endpoints are driving me insane.

Maybe I'm just not getting it, but I have a service that is deployed to an IIS 6 machine. That machine has a LAN address and a Public internet address. How on earth am I supposed to be able publish this service with both accessible? Address 1: http://serverName/ServiceName/Service.svc Address 2: http://www.companyName.com/ServiceName/...

How to dynamically load (and use) .net library with properly established dependencies using library versions?

Situation overview. We have several projects used in multifunctional system. objectAccessLibrary.dll (multiple versions) dispatcherHandler.dll (v.1.0) (dependency: version independent part of objectAccessLibrary.dll) Event handlers: handler_01.dll, handler_02.dll, handler_03.dll. Dependencies: dispatcherHandler.dll (v.1.0), objectA...

RunWorkerCompleted not executed in the main UI thread?

I have experienced an odd behavior of the BackgroundWorker or the .NET framework when rethrowing an Exception in the RunWorkerCompleted event. Exceptions occuring in the background thread are passed to RunWorkerCompleted. There I do a object temp = e.Result to rethrow the exception. Since this is supposed to happen in the main UI thread...

EDI Parser in .NET

Has anyone created a .NET application that reads and parses an EDI file? EDI file - used by shipping industries to provide information on shipment invoice. ...

Does Streaming a WCF Soap Help the Client Send Using Less Memory?

I have a windows mobile application that sends data via WCF to a server. The data it sends sometimes exceeds the limit on the windows mobile device. I am wondering if streaming would help not need to hold all the data I must send in memory at once. Here is a simple example: [DataContract] public class MainContract { [DataMember] ...

Is the parsing part of SqlConnectionStringBuilder available in the FCL?

I'm using a SqlConnectionStringBuilder instance to parse a connection string, but don't want to check its key names for validity. By behaviour the builder will throw an exception if an unsupported key is encountered in the string. For example, exception on unknown key "whatever" is: Keyword not supported: 'whatever'. What I wa...

Can I use Razor (or similar) in a regular .NET class, i.e. get string interpolation of sorts?

I could've sworn I saw some articles a while ago about imperfect but useful string interpolation methods for C, but no such luck right now. However, there's Razor, which does more or less what I want. Suppose you have a database client application with tickets, and e-mail notifications are to be sent whenever tickets get created, signif...

Class library usable by both .NET 3.5 (2.0?) and 4.0 applications?

I am starting a new class project, and I'd like for it to be usable by both .NET 3.5 and 4.0 projects. If I build it for .NET 3.5, do I need to do anything beyond that? Will it be safely usable by .NET 4.0 projects without having to be compiled for it? Are there any incompatibilities? I know that, as an example, .NET 1.1 was supposed to...

C# Multithreaded application and SQL connections help...

I need some advice regarding an application I wrote. The issues I am having are due to my DAL and connections to my SQL Server 2008 database not being closed, however I have looked at my code and each connection is always being closed. The application is a multithreaded application that retrieves a set of records and while it processes...

Understanding Json structure generated by an AJAX-enabled WCF Service

Good afternoon In Visual Studio 2010 I am able to add to my solution a new item called in AJAX-enabled WCF service. That will add a new a .svc file. Later, I have created a method just for debugging purposes: [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allo...

How to create Windows Mobile 6.5.x finger friendly stock controls?

I'm developing a Windows Mobile application in C# using .NET Compact Framework 3.5. My target version of WM is 6.5.x. It was my impression that Microsoft has updated the stock controls in this release of the OS to be more finger friendly (larger fonts, greater space between rows in listboxes, etc.) but when I create, for example, a ListB...

Active Directory / Distrubution List in.NET

I have the following code that gets the members of a distribution list but if there's a another list within it I'd like to get the members from it too. Try Dim path As String = String.Empty path = "LDAP://...." Dim de As DirectoryEntry = New DirectoryEntry(path) Dim ds As DirectorySearcher = New ...

Question about Writing an XML File in .Net?

Hi, Below is the XML schema I am trying to conform to: <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt; <url> <loc>http://www.example.com/&lt;/loc&gt; <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> ...

How to index Word 2003, 2007 and 2010 documents using Lucene.NET

I am writing a custom Lucene.NET indexer to enable indexing of MS Word documents. The indexer must be capable of handling last three releases of MS Word: 2010, 2007 and 2003. The plan is to use VSTO interop assemblies that are installed as part of VS2010 to extract text content from the documents. Is there a better way to implement Wor...

Pass a method as a parameter

I want to be able to pass a method as a parameter. eg.. //really dodgy code public void PassMeAMethod(string text, Method method) { DoSomething(text); // call the method //method1(); Foo(); } public void methodA() { //Do stuff } public void methodB() { //Do stuff } public void Test() { PassMeAMethod("calling methodA",...

WPF ListBox with ItemTemplate problem

I have a listbox and I am trying to Bind DataTable with it. I debug the Code and there is data in the DataTable but it does not show the data inside the DataList. <Window.Resources> <local:myCurrencyColor x:Key="CurrColor"></local:myCurrencyColor> </Window.Resources> <Grid Name="grid1"> <ListBox Margin="28,111,130,24" N...