.net

CruiseControl.NET Build Label Problem.

I'm labeling my assemblies using the CCNETLABEL environment variable and the SVN Revision number. The problem I am facing is as follows: Assume ProjectA is dependent on ProjectB ProjectA is at build number X and ProjectB is at build number Y When ProjectA is triggered, ProjectB is built as well. Because CCNETLABEL = X+1 my version l...

Export Data to Excel without Server-side install

Hi, I want to export my data from grid view to the excel. Unfortunately i came to know that there is no excel software on server side. Is there any way that i can still export data in excel format without having excel software on server side. Thanks. ...

Communicating Concurrency Conflicts to the Application Layer

When communicating concurrency conflicts to your application layer, is there an alternative to using exceptions that also respects the principle of Command-Query Separation, or are exceptions the best mechanism we have (in languages that support exceptions)? In the bowels of my application, I have optimistic locking logic that executes ...

C# Regular Expression - Why some char not in it validate the IsMatch() condition :(

Hi, I use this regular expression for validating some of my textbox : Regex re = new Regex("^([äö\x20\x27\x2C\x2D\x5Fò-öà-âù-üç-ï0-9a-zA-Z]+)$"); And when i put "<" or ">" in one of this textBox, my condition shoud be false and not true :) if (re.IsMatch(TextBox.Text)) /*do something */ else Console.write("error invalid char in text...

confused about how to use JSON in C#

The answer to just about every single question about using C# with json seems to be "use JSON.NET" but that's not the answer I'm looking for. the reason I say that is, from everything I've been able to read in the documentation, JSON.NET is basically just a better performing version of the DataContractSerializer built into the .net fram...

ConcurrenctBag(Of MyType) Vs List(Of MyType)

What is the advantage of using a ConcurrentBag(Of MyType) against just using a List(Of MyType)? The MSDN page on the CB (http://msdn.microsoft.com/en-us/library/dd381779(v=VS.100).aspx) states that ConcurrentBag(Of T) is a thread-safe bag implementation, optimized for scenarios where the same thread will be both producing and ...

'Timeout Expired' error when buffer cache clean

I am going to sum up my problem first and then offer massive details and what I have already tried. Summary: I have an internal winform app that uses Linq 2 Sql to connect to a local SQL Express database. Each user has there own DB and the DB stay in sync through Merge Replication with a Central DB. All DB's are SQL 2005(sp2or3). We...

modified closure warning in ReSharper

I was hoping someone could explain to me what bad thing could happen in this code, which causes ReSharper to give an 'Access to modified closure' warning: bool result = true; foreach (string key in keys.TakeWhile(key => result)) { result = result && ContainsKey(key); } return result; Even if the code above seems safe, what bad t...

want to give "logon as a service " rights to the account

i have found a solution using LsaAddAccountRights() win32 api but i was not able to figure out what parameters to give. Here is the code http://www.roelvanlisdonk.nl/?p=1151 Thanks ...

MSMQ wcf activation issue with .net 4.0 and server 2008

I have .net 4.0 application ported from net 3.5 that uses net.msmq running on server 2008 x64 Setup net.msmq Service with address "net.msmq://localhost/private/msmqdataservice.svc" net.msmq endpoing with address "net.msmq://localhost/private/msmqdataservice.svc" queue in MSMQ -> name = "$private\msmqdataservice.svc" everything is wo...

Find type given generic base type and implemented type.

Here is what I have. BaseClass<T> { } MyClass { } NewClass : BaseClass<MyClass> { } I need to see if there is a class that implements the BaseClass with the specific generic implementation of MyClass and get the type of that class. In this case it would be NewClass Edit AppDomain.CurrentDomain.GetAssemblies().SelectMany(s => s.Ge...

BackgroundWorker RunWorkerCompleted in a Component

I'm familiar with the following: "If the operation raises an exception that your code does not handle, the BackgroundWorker catches the exception and passes it into the RunWorkerCompleted event handler, where it is exposed as the Error property of System.ComponentModel.RunWorkerCompletedEventArgs. If you are running under the Visual ...

Entity Framework or something else?

I am just switching from C to C# and would like to invest sometime learning database work. I am overwhelmed with the options: Linq-to-sql, ADO.NET. nHibernate, EntityFramework, plain old sql (I am used to this). Since I have only limited 'learning' hours available (about 2.5 hours per day), where should I invest my time? I don't want to...

Does binarywriter.flush() also flush the underlying filestream object?

I have got a code snippet as follows: Dim fstream = new filestream(some file here) dim bwriter = new binarywriter(fstream) while not end of file read from source file bwriter.write() bwriter.flush() end while The question I have is the following. When I call bwriter.flush() does it also flush the fstream object? Or should ...

Determining an Oracle SQL MERGE statement result

Follow up to this question This (similar version from old link) works in SQL Server 2008, however, Oracle is giving me trouble: MERGE INTO wdm_test USING ( select '10000000000000000000000000000000' Guid from DUAL ) val ON ( wdm_test.Guid = val.Guid ) WHEN MATCHED THEN UPDATE SET test_column = null WHEN NOT MATCHED THEN INSERT (Guid, ...

What .NET UnmanagedType is Unicode (UTF-16)?

I am packing bytes into a struct, and some of them correspond to a Unicode string. The following works fine for an ASCII string: [StructLayout(LayoutKind.Sequential)] private struct PacketBytes { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string MyString; } I assumed that I could do [StructLayout(LayoutKind....

Problem with assembly loading in .NET

Hi guys, I have got two projects in my solution: Silverlight and standard one. The standard one references System.Xml assembly (version 4.0.0.0), however the Silverlight one references System.Xml assembly (v. 2.0.5.0). I want to make an instance of XmlWriter in my Silverlight project. Here comes the problem - the exception is thrown (fi...

show data from sql server in blackberry using .Net

Hi all, i want to ask about development in blackberry. I have background in .Net winform. If i want to develop an application to show data from Ms.SQL server 2008 database in blackberry. what should i learn and what should i do ? thank you for your advice. ...

How to deploy DevExpress to server?

Hello I am needing to deploy a project using DevExpress controls to an IIS 6.0 server. The project loads fine and until I add in the DevExpress controls. When trying to load the site I get the error Could not load file or assembly 'DevExpress.Web.v9.3, Version=9.3.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or one ...

How a web app identify if a click came from another web app via code?

Hi, we have a web application that users can take online reports from ou ERP system data... And we have another web application that is used by our teachers and employees. We can't change the ERP web app because its a closed DLL, in this case we made some extended functionality in our custom internal web app and we are willing to put t...