I have an attribute to mark enum fields named BusinessDescription.
public enum FailReason
{
[BusinessDescription(Description="the client cancelled the order")]
Client = 0,
[BusinessDescription(Description="vender cancelled", DBValue = 1)]
Vender = 1,
[BusinessDescription(Description="other")]
Other = 2
}
You see, the...
Hi, this might sound like a daft question but I can't seem to find a obvious answer. I have to quickly create a simple WCF service and I have created all the classes I need decorated with the DataContract and DataMember attributes and I have created a custom exception class and everything is working. However if an exception is thrown w...
I am building some kind of eBook reader in C# and have the following problem. Rendering HTML in the WebBrowser control just works fine. However, I want to be able to mark text samples with the mouse. This should be available via a button event or (even better) by click-and-drag directly onto the text. How can I get the feedback of the mo...
.NET is a language independent platform.
But is it platform independent as well ? How ?
EDIT :
I have heard, .NET 4.0 is developed considering plateform independency ! Well, hope it may take over Java, if so !
EDIT :
The answer depends upon the way how we define 'platform', like .NET for windows platform and Mono for Java.
But, the...
In my load event on a form, I call some method in a try catch block. When an Exception occurs, I show the user a message and after that I want to close the form. It looks like this (code in Load event):
try
{
Metehod();
}
catch(DatabaseException ex)
{
MessageBox.show("db error! " + ex.Message);
this.Close();
}
catch(Exception ex)...
when the process run in the same browser, it's easy to open a new TAB and check the session variables there, everything works fine in this situation.
But when a webpage runs inside a WebBrowser Control (under Windows Forms) for example, I can no longer get any Session Variable that process is using.
Does anyone have an idea on how t...
Does C# allow a variable that can't be modified? It's like a `const`, but instead of having to assign it a value at declaration, the variable does not have any default value, but can only be assigned a value once at runtime (EDIT: and possibly not from constructor). or is this not possible?...
how to create a dynamic grid view and a drop down box in its header ?
where should this be called like in page load ?
where should the events be handled ?
...
Student Table
UserId
Name
Surname
Results Table
ID
UserId
Year
Symbol
Student has many results. There is a one-to-many relationship on the UserId fields.
I am using Dynamic data for my admin section. When I go to the list page for students in dynamic data, I want to be able to click on a Student and then view that Student's resul...
Hi
I'm trying to plan a architecture for a robot-controller application, which will be written in WPF. Since that MVVM is the de facto pattern for WPF, and in general is much more sexy I decided to use it as a base layout.
The application will have some controllers that access hardware, beyond the domainmodel that represents the databa...
I am testing how big a collection could be in .Net. Technically, any collection object could grows to the size of the physical memory.
Then I tested the following code in a sever, which has 16GB memory, running Windows 2003 server and Visual Studio 2008. I tested both F# and C# code, and looked at the Task Manager while running. I can ...
Hello,
Anyone knows how can i start to develop a multitenant site in MVC2, in a way it run on Windows Azure?
I search a lot about this question, and i allways find theoric explanations, everybody says it can be easily done, but i dont find any sample...
Can someone explain me where to start?
Thanks,
João
...
I have a simple Form-Based .NET application. In this I capture the FormClosing Event to prevent the closing of the application, instead I minimize it. The application should always be open. Here is the code I use:
private void Browser_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.WindowStat...
Java is the supported language by .NET.
Where is it used ? Is there any IDE available for programming with Java.NET ?
Isn't Java.NET a platform independent ? Can we compile it using JVM ?
...
I have a unit test project which contains a few XML files for data driven tests.
These files are set to Build Action Content and Copy if newer or Copy always.
For the most part, this works fine. However, when I change one of the data files without changing any code, Visual Studio will not trigger a build action at all, and no XML files ...
We have a C++/CLI class, let us call it class A, from which we would like to register a non-static callback ("MyNonStaticCallback") into an unmanaged C++ class (class B).
e.g.
void MyNonStaticCallback(void* ...)
{
// Raise a C# event from this code
}
// Register callback into class B
myClassBInstance->RegisterCallback(..., &MyNon...
Disclaimer : I am a novice in WCF and SOA :P
I am just starting out on these, I have a theoretical doubt :
Client A has called a service and the logic is currently executing on the server. While the logic is executing, another call from Client B comes in for the same service.
At this point what happens to the logic that is being ex...
how to detect machine has at least DOTNET 2.0 or newer installed?
registry key preferred.
...
Hi,
So i have such code.
public interface IGeoDataSet<out T> : IDataSet
where T : IGeoPrimitive<IGeoPrimitiveContent>
{
IEnumerable<T> Items { get; }
}
public interface IDataSet { }
public interface IGeoPrimitive<T> : IPrimitive
where T : IGeoPrimitiveContent
{
T Content { get; }
}
public interface IPrimitive { }
p...
Hi, I have a custom validator (.net 3.5) that checks if four dropdown lists in my form have repeated values. It works on the server-side but I would like to add a client-side function to go with it. I have no knowledge of JavaScript. Could you help? Mant thanks.
<asp:CustomValidator id="CustomValidator1" runat="server" ErrorMessage = "...