What's the best way in code to compare enum values? For example, if I have the following enum type:
public enum Level : short {
Low,
FairlyLow,
QuiteLow,
NotReallyLow,
GettingHigh,
PrettyHigh,
High,
VeryHigh,
}
And I want to be able to write statements such as:
from v in values select v where v > L...
Example:
\Doe, John\" <15553775555>"
The regex is \<(.*?)> and match <15553775555>. But it would be more accurate if it would return only what is inside the < >. How can we modified it to have what's inside? (By the way, what's inside can be not only a 12 digits...
...
I'm looking for a way in C# to determine the quote character for an ODBC connection. I'm trying to get it to work reliably to many different ODBC data sources without having to special case for individual ODBC drivers.
I'm familiar with the ODBC API SQLGetInfo from:
http://msdn.microsoft.com/en-us/library/ms711681%28VS.85%29.aspx
but ...
Hi
I have site that users lots of ajax(jquery). Now if the user times out for whatever reason(walked about for 30mins or something). On there next action I want them to be returned to the login page.
I setup everything in the webconfig(returnUrl and timeout) and if they try to go to a page they have no premission to go to they get sent...
I don't want to write my own because i'm afraid i might miss something and/or rip off other people's work, so is there an ObjectPool (or similar) class existing in a library for .NET?
By object pool, i mean a class that assists caching of objects that take a long time to create, generally used to improve performance.
...
Hi there,
I now have a scenario where I have 6 console apps on my server which each host a WCF service.
It's getting messy and I am now thinking about having a windows app (probably WPF) which hosts each service in a separate thread. This would mean there's a central place to manage the services as well.
I'm just wondering if anyone h...
We keep getting this bug intermittently and recycling the app pool fixes it for sometime but then it comes back again. Has someone narrowed down the cause for this issue and found a permanent fix?
Also this happens only on production machines and not on dev or staging.
The web config has both entries as shown below:
<configSections>
...
I know a lot of question regarding VB6 migration have been asked, but I don't believe my exact situation has been answered in them.
Basically, our company is wanting to migrate our mission-critical VB6 Line-of-business app that is quite large, uses custom libraries to communication to other in-house programs and some dll's we don't have...
Hi there,
i am using the Plain old XML template from WCF REST Starter Kit Preview 2 to build a REST service and i would like to set the ResponseFormat inside the OperationContract, not outside(not with ResponseFormat = WebMessageFormat.Json) because i want to set it accordingly to the Accept Header in the Request. and ideally i would lik...
I'm building a Wpf app that currently has a toolbox which looks and functions similarly to the Visual Studio toolbox. I have a range of classes that are represented in the toolbox and different types of objects that can each contain some, but not all, of the toolbox items.
As a stopgap measure to get my app up and going, I hardcoded the...
Using the new .net printing API (System.Printing.dll) how do you get the IPAddress of a network printer?
The classes i am looking at are
http://msdn.microsoft.com/en-us/library/system.printing.printqueue.aspx
http://msdn.microsoft.com/en-us/library/system.printing.printserver.aspx
Here is some example code
PrintServer printServer =...
Hi,
I have created a project in C#.net in which it has reference to third party assemblies.
But when the version of the assembly in customers's machine changes with the copiled version it is failing to load the assembly sometimes.
So I want to re-direct to a New Version of Assembly by using "bindingRedirect" element "newversion" tag in ...
I have a program which I believe to be running in .NET 4.0, but I am unable to mixed-mode debug it (something new .net 4.0 for 64-bit application)
I wanted to confirm if I'm truly running in .NET 4.0 or is it running .NET 3.5
Is there a way to look in the memory space or something?
...
Hi there,
I'm using the EF and wondering how other people are separating the Data Context from the Entities.
Basically i need one tier to access the Data Context (the model object) to call SaveChanges() etc.. and other tiers need access to the Entity type itself. So for example if a method returned an Entity and i called that method fr...
I'm working on an ASP.Net custom control. In my control I have a FileUpload control, inside a MultiView, inside an AJAX UpdatePanel.
I've added the submit button to the post back triggers of the update panel. (This is the standard fix for getting a FileUpload to work within an UpdatePanel).
On the first submit the FileUpload does not u...
I would like to compile and distribute (on .net) some python programs that work well with IronPython, but I am new to .net and am getting errors related to particular python modules. There is a utility for compiling to low level .net and it works well, but I get errors when dealing with common libraries; code that runs in the interprete...
I have The following code for now.
type
TByte4 = array[0..3] of Byte; // 32-bit
function CardinalToBytes(const Data: Cardinal): TByte4;
begin
Result[0] := (Data shr 24) and 255;
Result[1] := (Data shr 16) and 255;
Result[2] := (Data shr 8) and 255;
Result[3] := Data and 255;
end;
function BytesToCardinal(const Data: TByte4):...
If I can open a connection to an MS Access file in C#, how can I retrieve a list of the different tables that exist in the Access DB (and if possible, any meta-data associated with the tables)?
...
Hi there,
i'd like to create a windows service that would be accessible via WCF from a web application.
The workflow would be:
Windows Service starts and would hold a default value in memory.
A web app would connect the windows service via wcf and take the value and after some processing set the value back in the memory.
In a while wo...
Hi,
I wonder what happens if the user closes his/her browser while a called business service method is still processing? Does it keep going working without being aware whether the user has his session closed or not? Or the process suddenly stops?
Thanks.
...