I have declared an enum in my server code, and would like my client code to be able to use it. Unfortunately, it's not being auto-generated for some reson. My enum is declared similar to the following example:
[DataContract]
public enum MyEnum {
[EnumMember]
First = 1,
[EnumMember]
Second = 2
}
It's not declared inside...
Can .NET (managed code) read and write to CouchDB?
I would like to build a part of my project that does document management using CouchDB
...
Hi all,
This question is sort of a pool. We are trying to identify the best archtecture while using a ORM like LINQ to SQL. The archture we are defining is for sort of framework that other applications will access either trough directly referencing the DLL or through a webservice. We have .NET apps and PHP apps.
The possibilities are:
...
Is there a preferred algorithm for converting a 2-digit year into a 4-digit year?
I have a 2-digit birth date (along with month and day) that I want to convert to a C# DateTime. Obiviously, birthdates cannot be in the future, but is there an existing facility in .NET to convert a 2-digit year into a four-digit year?
...
I’m used to having try/catch blocks in every method. The reason for this is so that I can catch every exception at the point of infraction and log it. I understand, from my reading and conversations with others, that this isn’t a popular view. One should only catch what one is prepared to handle. However, if I don’t catch at the point of...
I use to use IDL and MatLab in college and now that I have been working for some years I miss the : notation for indexing into arrays. I.E.
arrray[1:5]
which would return an array from elements from 1 to 5. Another example is
stringVar.Split(")".ToCharArray())[1:*]
which would return an array of strings skipping over the first ele...
Our C# client applications always take a much longer time to load on their first run. I haven't gone so far as to test if it is the first run of any .NET app that is slower, or if the first run of each .NET app is slower, but it remains a problem in any case. How can we eliminate this one-time startup hit?
My initial thoughts are that...
Okay, so we have a utility here in-house that generates business-model classes from our database tables and views, similar to (but not quite exactly like) an ORM. In maintaining it, it occurred to me that the data in the schemas isn't likely going to change a whole lot. The functionality, however, might. We may want to add additional fun...
Possible Duplicates:
When do you use the this keyword?
Best practices for using the this keyword in C#
I have a style question regarding the this keyword. Do you use this when self-referencing auto-implemented properties or methods within a class for the sake of clarity?
For one example, in your Constructor, do you write you...
When an application adds an icon to the system tray and minimises to it, there must be a way to restore it. However, when it comes to restoring the window I'm not sure what the 'correct' behaviour is for applications.
Do I restore on a double click, on a single click, or not at all? What's the Windows standard?
...
Hello all.
I am currently working on an application for managing a WPD device.
I want to add an option to open the wpd device in windows explorer to view the saved files.
Problem is that I can't find a way to open explorer pointing to the device's "folder".
I have all information of the device (pnp device id, class name, etc.)
Anybody kn...
I've set up an activex control to run on a webpage. The server is able to serve this webpage to itself, but other machines on the intranet and internet aren't able to access it.
The Caspol settings look like this:
Code Groups:
1. All code: FullTrust
1.1. Zone - MyComputer: FullTrust
1.1.1. StrongName - (omitted) : FullTru...
In the process of refactoring some code I encountered several build errors like these:
Library project file cannot specify ApplicationDefinition element.
The project file contains a property value that is not valid.
How can these errors be resolved?
...
I want to be able to read vCard and vCalendar data using .NET, I have something which does this, and have looked at the specification.
For those not familar with the format here is some test data from my current application:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Microsoft Corporation//Windows Calendar 1.0//EN
CALSCALE:GREGORIAN
METHOD...
In my typical app, the user clicks a button in an aspx page, invokes a C# business object, then runs a stored procedure.
Should role checks be done at the top of the stack, the bottom of the stack or at every level? It seems that if a malicious user can invoke one method, he could invoke any, so for effective security, you'd need a ...
I'm getting an Object Disposed Exception when I try to call TraceSource.TraceData with my VS2008 unit test project. I have included a very small code sample below which consistently repros the issue. I'm only seeing this after I run my first unit test - but I have a hunch it'll affect me once my website is up and running with lots of u...
My project contains a large number of classes with properties whose backing field is marked readonly as they are only set at construction. As a matter of style, I like using auto-properties as it eliminates a lot of boilerplate code and encourages use of the property member rather than the backing field. However, when using an auto-pro...
using a dataset,each row has a method called hasVersion() which implies to me it keeps a copy of the original and current versions of that row. How can I get one of the original row values?
I'd imagine it's possible to call reject changes on that row and then check the value, but I'd rather not lose the changes, just read the value(s)....
I'm bringing down a strongly typed dataset table into a datagridview. then adding a column of combo boxes to let the foreign keys be selected by name instead of ID. Perhaps there's an easier way to do this.
can I transform the typeID column into a comboboxcolumn while still being able to cast the datasource back to my strongly typed da...
Wikipedia seems to say that C++0x will support anonymous functions. Boost also seem to support it. However I'm using .NET so if I could stick with it it would be awesome.
Basically I just want to write some quick code for objects. I have a robot which can have about 85 - 90 states. Most of the states are just "integer values passed to t...