.net

Architecture for dynamic business rules

I am creating a payroll application in .NET. One of the requirements is that the attendance and deduction rules should be dynamic and flexible to the most extent. The user should be able to define his own rules, where every employee will be bound to an attendance rule. One solution is to compile C# code on the fly where the code to eve...

Html to pdf some characters are missing (itextsharp)

Hi,I want to export gridview to pdf by using itextsharp library.But problem is some turkish characters such as İ,ı,Ş,ş etc... are missing in the pdf document.Code used to export pdf is ; protected void LinkButtonPdf_Click(object sender, EventArgs e) { Response.ContentType = "application/pdf"; Response.ContentEncodi...

Is it possible to debug .NET Class Library Methods as well?

With .NET Reflector we can see many .NET Class Library method's implementations. But is it possible to debug them as well? Or if I can put a break point inside them? ...

Prevent form from freezing

I'd like to download a picture and afterwards show it in a picturebox. at first I did like this: WebClient client = new WebClient(); client.DownloadFile(url, localFile); pictureBox2.Picture = localFile; But that wasn't perfect because for the time while the download is performed the app is kinda freezing. Then I changed to this: pu...

Inhibiting registry virtualization programatically

In the context of a generalized .NET-based component, which can be hosted in a variety of scenarios - i.e., 64 bit or not, interactive process or not, I need to write to the registry in an area that's subject to UAC virtualisation. However, I want to prevent such access from being virtualized in order that each execution is not subject t...

MVVM with TreeView - add nodes

I am new to WPF, and I am trying to implement MVVM with TreeView according to an example. However, in addition to the functionality in the example I would like to be able to add nodes to the tree (i.e. add new child to a specific node in the tree during runtime). My question is, should the new nodes be added to (a) the model or to (b) t...

What is a precise way to block a thread for a specific period of time?

The system I'm working on needs to consume an IEnumerable of work items, iterate through each of them, and in between them wait for a certain period of time. I would like to keep the system as simple as possible at the enumeration site. That is, I'd like to have a method that I can call at the end of the foreach block which will block fo...

ncover merge reports

we are using NCover from http://www.ncover.com/ For our application we have 6 different solution and we create report for each solution. In NCover explore there is MergeData option which I can use to merge all Coverage.xml. But I want some functionality from command line which I can use in NANT script, has anybody got any idea how to do...

How to obtain a working X509Certificate for my WCF Service hosting

I am in the process of hosting my WCF services in my asp.net hosting account and I want to use X509Certificate for authentication of communication. Where do I get a certificate in this instance? Make one and then Ftp it to my account? If yes, how do I reference this certificate for use. If No, how do I get one for use please? Do I need t...

Is this a valid XML file?

Hello everyone, I need to send some XML element to some other services and I want to ensure my XML file is of elegant format so that other people could use their XML parser to parse the XML file. For such kinds of XML file, is it elegant format, breaking any rules of XML? Not sure whether &#x4 is valid XML character sequences in .Net/C...

how to show an image from memoryimagesource?

return toolkit.createImage(new MemoryImageSource(rawWidth, rawHeight, oneDPixMod, 0, rawWidth)); anyone knows how to show that image using panel or label maybe? do i need to use class Graphic, like g.drawImage()? thks for the answer ...

LINQ Keyword search with orderby relevance based on count (LINQ to SQL)

This is what i have now as a very basic search: var Results = from p in dx.Listings select p; if (CategoryId > 0) Results = Results.Where(p => p.CategoryId == CategoryId); if (SuburbId > 0) Results = Results.Where(p => p.SuburbId == SuburbId); var OrderedResults = Results.OrderByDescending(p => p.ListingType); OrderedResults = OrderedRe...

What is an Extension Class?

My teacher asked us to investigate what an Extension Class was but I can't seem to find anything on MSDN or Google. Any help? ...

Two .NET projects, one DB connection string?

I have a .NET solution containing two projects: An ASP.NET MVC project, 'Website' A class library, 'Models' The 'Models' project contains a Linq-to-SQL data-context along with a few partial classes that extend the database objects. The connection string is defined in the web.config of the 'Website' project. However the 'Models' pro...

.net Provider for AQL

I am looking for a .net provider for AQL (HP OpenView), formerly known as Peregrine ServiceCenter. Is there any open source provider available? Thanks, ...

best place for data processing logic with .NET/Oracle architecture

I'm a .NET programmer, and I'm developing a system that collects real time production data and stores it in an Oracle database. The data will need to undergo extensive processing: essentially digital signal processing stuff--looking for mins and maxes of various fields in a datastream and categorizing "chunks" of time accordingly. Appa...

C# class size calculation

In C# (.NET) how exactly methods (virtual, static, non-virtual) impact on class size? ...

Serialize [Flags] enumeration as string

Is there a way to specify that a [Flags] enumeration field in a class should be serialized as the string representation (e.g. "Sunday,Tuesday") rather than the integer value (e.g. 5)? To be more specific, when returning the following SomeClass type in a web service, I want to get a string field named "Days" but I'm getting a numeric fie...

combobox doesn't hold new index on postback if set to 0

I am populating an ajax toolkit combobox based on the selection in another field. On the postback I always want to set the index of the combobox to 0 (the first value in list). If I programmatically always set it to 1 or 2, it works and the selected index and displayed value are correct (assuming there are enough values in the list). How...

In VS2008 what is the difference between Web Site and Web Application?

In VS2008 what is the difference between Web Site and Web Application? And are there advantages to using either one? ...