.net

Simple C# Xml Serialization

I have a class: public class Car { public string Model {get;set;} public string SeatFinish {get;set;} public string Audio {get;set;} } I want to use XML serialization attributes to serialize it to the following xml <Car> <Model>name</Model> <Options> <SeatFinish>Leather</SeatFinish> <Audio>5 speaker</Audio> </...

Is there an existing solution for WebRequest caching in .NET (based on If-Modified-Since)?

I have an expensive WebRequest that I know can be cached. Is there an existing solution that allows caching of web requests based on Last-Modified/If-Modified-Since and (optionally) ETags? ...

clear singleton pattern concept please

Hi I want to make connection with sql server DB and maintain in singleton pattern. So is this functionality inbuilt in dot net ? or we mannually have to write the code for this scenario? ...

Using MAYA 3D Model in a .Net application

If I want to render a 3D model created by Maya and do some animation with it in a .net application what should be my choice of platform - plain WPF or XNA? ...

Making a web page as a default page for the server name where the application is hosted

Hi All, Suppose I have a server wid some virtual name as ABC. And also I have a .Net web application XYZ with some .aspx pages like Home.aspx etc. Now if I want to make Home.aspx page as the default page when I type the server name in brower the Home.aspx opens automatically. what I need to do in this case. Currently Iam accessing the...

Java Equivalent of .NET's ManualResetEvent and WaitHandle

Hello fellow StackOverflowers (<--bad pun), I would like to know if Java provides an equivalent of .NET's classes of ManualResetEvent and WaitHandle, as I would like to write code that blocks for a given timeout unless an even is triggered. The .NET classes of WaitHandle and ManualResetEvent provide an nice, hassle-free interface for t...

How to programmatically configure a proxy server for connectivity on the local network to the internet using a windows application

How to programmatically configure a proxy server for connectivity on the local network to the internet using a windows application. Please suggest a good example/reference. Screenshot shows the windows application form for setting proxy server ...

Passing data from the model into custom validation class

I have a data validation class that checks whether the start date of a meeting is before the end date. The model automatically passes in the date that requires validation, but i'm having a bit of difficulty passing the data that it needs to be validated against. Here's my validation class sealed public class StartLessThanEndAttribute ...

How to impersonate a non-existent user

We have a 3rd party webservice used to authorise users. Primarily it takes the calling user, checks their identity, and returns a cookie for subsequent requests. I would like to unit test it, making sure it throws the appropriate exception. Ideally something like this: var dummyIdentity = WindowsIdentity.GetAnonymous(); using (dummyId...

dependency management and release lifecycle in dotnet

Recently my team has hit the wall while trying to manage dependencies semi-automatically. You know, the trunk/lib folder in svn with a ci-server that commits fresh versions of dlls into that folder. But migration of one of the projects from svn to git exposed the problem that repository is growing too fast and we are trying to use svn a...

.NET 4.0 dynamic - Getting more information about members returned from GetDynamicMemberNames

I am getting the members of a dynamic class using the following method: public static IEnumerable<string> GetDynamicMemberNames(this IDynamicMetaObjectProvider dynamicProvider) { DynamicMetaObject metaObject = dynamicProvider.GetMetaObject(Expression.Constant(dynamicProvider)); return metaObject.GetDynamicMemberNames(); } How can ...

How can I code a set of numbers to a file so that the file has a minimal size?

I have to code some algorithm's result in a file. A Result is a list of blocks, each one defined by 5 numbers: 3 ints and 2 floats. The simplest way to code it in a file is of course plain text, for example like this: 12 56 81 0.34 1.67 124 11 76 0.75 6.11 ... It is also the worst way taking the file size into account. How could I...

Advanced manipulation on automatic data binding in .NET, architectural problem

I have application with following data flow: SqlDatabase -> SqlDataAdapter + SqlCommandBuilder -> DataSet -> DataGridView All conversions and bindings are automatic. This is all simple and functional and I can load all kinds of databases with simple code. Problem is with BLOBs, they are treated as Image in DataGridView. My question is...

Method call overhead

Hi I'd like to know what's the overhead of calling a method- in .Net -which returns inmediatly (because a condition which is the first code inside is not met). I'd argue that no matter how real-time your application is, that overhead is negligible and that in any case profiling should show the facts, being readability more important, ...

C# ftp download and stream to XML error

I'm trying to get an .xml file that's somewhere on a server loaded into a streamerader to stream it to XML and process it. This is what i get: EndOfStream = 'reader.EndOfStream' threw an exception of type 'System.ObjectDisposedException' I do see that im logged in on the server etc: StatusDescription = "226 Transfer complete.\r\n" It ...

Why I can't add a class library project reference to a Silverlight project?

Hi, I am a newcomer to Silverlight and while I have been following some tutorials I wanted to create a new project with a class library so that I can use it from my page's xaml.cs code behind. But when I tried to add my class library project I get a warning message saying: You can only add project references to other Silverlight proje...

Oracle Transactions doesn't work as expected in some client machines in a .net windows application

Hi. I have an windows application in VB.NET (2.0) and Oracle Database, the connections are handled by System.Data.OracleClient. My oracle client is 10g. In the server side, the AutoCommit is off. The application uses transtactions (isolationLevel: ReadCommitted) for certain operations. The problem is that in some machines (and only in...

Dont understand IEnumerable<T>

Hi, I'm having alot of trouble with my code. When I compile I get the following error: 'Ecommerce.DataHelpers.ProductNodeLoader' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'Ecommerce.DataHelpers.ProductNodeLoader.GetEnumerator()' cannot implement 'System.Collections.IEnumerable.GetEnumerator...

Grabbing a nodelist from a nodelist c# .net

The following code gives me a nodeList to itterate over: XPathNavigator thisNavigator = thisXmlDoc.CreateNavigator(); XPathNodeIterator dossierNodes = thisNavigator.Select("changedthisname/dossiers/dossier"); I am processing this nodeList, and i need to grab another nodelist out of this list. I am trying to do this by using this code...

How can i build an Online word Processor using .net.. Libraries in .net for MS word files???

I'm a student doing final year of my Computer Science and Engineering. For my final year project i've choosen to do an online word processor such as google docs,zoho etc.I want to implement this project in .net. This will be a ajax oriented project and i'm well prepared with the web related part of it with ASP.net and C#.net at the serv...