.net

Export a Table of Contents to Word

Hey Can any One help me ? I am creating a table in C# using HtmlTextRender and i am getting the innertext and the css is not working in that when i show it in Ms Word and also i am getting Table Lines and td tr lines. Thanks in advance :) Kishh ...

Serialize an arbitary string to XML in .NET

What is the best way to serialize an arbitary string (into an XML attribute or XML node) to a XML stream so that the XML stays valid (special characters, newlines etc. must be encoded somehow). ...

Get current system setting's fraction separator

In my app I parse a value from xml (string) to a double. The value in the xml happens to have the dot as a fraction seperator whereas the system takes the current system settings and can have a different separator (dev system takes the comma for example). Is there a way to tell double.TryParse() the dot is the fraction separator? Should...

How do you configure WCF known types programmatically?

My client/server application is using WCF for communication, which has been great. However one shortcoming of the current architecture is that I must use known type configuration for certain transmitted types. I'm using an in-house Pub/Sub mechanism and this requirement is unavoidable. The problem is that it's easy to forget to add th...

Why doesn't SQL Server come preinstalled with .net Framework for CLR Integration?

If I want to reference something in the .net framework for use in my CLR stored proc, for example, I have to first load it into the Sql server database. Why isn't it preinstalled? Is it performance related or for security issues or what else? thanks. ...

Trigger-Method of WebControl is not fired

this is my scenario: i have a page with a placeholder. the page adds dynimcally different kinds of controls (we wan't to display some data - getting the id via querystring or postback, as we also have a tree) to this placeholder. the added controls all, more or less, contain a textbox (name of the displaying element), checkbox (active-st...

Git change '.git' folder name in windows

Hi, By default git init creates a folder called '.git'. In the recent Visual Studio tools (2005 and up) this works fine. But Visual Studio 2003 (and ... VB6 as well probably) crashes on this foldername. ideally I would like to change this per repository to something like 'git' instead of '.git'. Is this possible? I know this has been a...

How to create VS solution for existing c project so that VS picks new files automatically?

I would like to port an embedded application to x86 to create an emulator. We decided to give VS2008 a try but I'm not sure how to make vs to understand our existing directory structure: arch/ arch/hcs08 -- HAL implementation arch/include -- public interface of HAL arch/x86 -- here should goes the emulation layer os/ os/src -- sour...

How can i arrange columns in asp.net gridview?

How can i arrange columns in asp.net gridview? i want to change 4 columns' location. ForExample: column1 | column2 | column3 | column4 | ChangeOrder() column2 | column1 | column3 | column4 | ChangeOrder() column4 | column2 | column3 | column1 | I want to move columns in Gridview. ...

.Net Release build working slower than Debug

I am experiencing a weirdest thing for the last couple of days. I found out that my Release build actually executes slower than the Debug version. 1. The problem I finally stripped all stuff from my entry point (Main) in my Windows Forms exe, leaving only this: [STAThread] static void Main(params string[] args) { Stopwatch sw ...

Speeding up build times in ASP.NET

I am currently involved in a ASP.NET project with about 40 projects in the solution. We are doing all our development in cloned Virtual PC environments so all developers have identical setups. That's all good, managing dependencies is easy, however building the solution is horribly slow. Virtual PC can only utilize one CPU so I'm really ...

Reusable Components, database connections and different environments

I am wondering what would be considered best practice when setting up reusable components / libraries in .net. I have a webservice that utilizes a library that contains a few database connection for interacting with databases. I am wondering how I should set my library up when it comes to specifying the connection strings. I need to be...

how can i build rule engine which can execute user defined if else rules in C#.net

hi I have requirement to build new rule engine in which i have rule like this which is stored in Excel sheet, in tabular format. <If> "Name = Nita " <Value> "200" <else> "Name = Gita" <value> "300" <LookInto> "/Name/@Income" I have two files say 1 n 2. i need to see in first file that whether Name is Nita or Gita. Based on executio...

Nant build fails - but only in TeamCity

Hi I have a nant build file set up which works fine from the cmd line but not in TeamCity. I've checked that the comand I execute is run from the same directory TC is working in and checked all the references but it still fails with the following error: [build] Compile the project using Debug configuration... [10:30:05]: [build] msbui...

How to export pound symbol from a C# Web App to Excel correctly? (£ is produced instead of £)

We're exporting some data from a website app into an Excel spreadsheet, however, when a GBP symbol is used, instead of outputting "£9.99" it produces "£9.99". Here's the code a colleague has written to produce the spreadsheet [tableOut is a StringBuilder that contains an HTML table]: string filename = "EngageReplies.xls"; Response.Cle...

Is it possible to make a parameter implement two interfaces?

Is it possible to define a function that takes in a parameter that must implement two interfaces? (The two interfaces are ones I just remembered off the top of my head; not the ones I want to use) private void DoSomthing(IComparable, ICollection input) { } ...

The || (or) Operator in Linq with C#

Hi, I'm using linq to filter a selection of MessageItems. The method I've written accepts a bunch of parameters that might be null. If they are null, the critea for the file should be ignored. If it is not null, use it to filter the results. It's my understanding that when doing an || operation is C#, if the first expression is true, t...

Web Services

A telecommunications website maintains details of a) Various models of mobile phones (like company(NOKIA,SONY etc.), Model Number, Description, Price) b) Registered members of the website (memberid, password) Discount of 5% is offered if you are a registered member of the site. Develop web services using .NET to i) Get the discounted pri...

AppDomain.GetCurrentThreadID vs Thread.ManagedThreadID for Windows API calls?

Hi, I'm trying to create a hook to monitor the current position of the mouse cursor. Nothing important, I just need to count some pixels during interface design and wanted to learn how to create a hook, so I decided to go for a hard way instead of a sane way. I've found example code which declares the following function: <DllImport("U...

How to design a provider independet DAL (.Net)

I am currently developing a query builder application, basically a simple graphical interface that should allow users with no knowledge of SQL to define various queries on a database (joins, select, update, insert, delete). I will be using .Net 3.5. My application should support multiple databases, it should work with MS-SQL Server, MySQ...