Copy / Paste Cells in Excel with C #

How to select a specific user range in Excel file and copy those cells and Insert copied cells Shift:=xlDown using C#. This is the VBA code I need to convert into C#: Range("A9:L9").Select Selection.Copy Rows("10:10").Select Selection.

Deserialize the XML response string to class C #

I know there has been a good amount of posts on this, though I find this topic of .NET very difficult to comprehend. I have an XML string that looks like this: <?xml version="1.0" encoding="UTF-8"?> <result command="searc

How to use the app.config file depends on the environment

We are a group of C#/.NET 4.5 developers working on the same application. The application has a set of configurations related to each developer machine, like the connection string to the DB, network related settings (proxies, IPs, credentials) and a

How to create a clustered index on Foreign Key-Sql Server

How to create clustered index on a foreign key field in SQL Server ALTER TABLE [PERSON_MAIL] ADD CONSTRAINT [PERSON_MAIL_Person_Id] FOREIGN KEY CLUSTERED ([Person_Id]) REFERENCES PERSON_KEY(Person_Id) When i executing above query,getting error like "

Creating the Secure Thread List with Reader Writer Lock

Completely editing the earlier version, Can the following implementation be the Thread Safe List implementation. I just need to know whether it would truly thread safe or not, I know performance wise there would still be issues. Currently version is

ConfigureAwait follows a pool thread

Here is a WinForms code: async void Form1_Load(object sender, EventArgs e) { // on the UI thread Debug.WriteLine(new { where = "before", Thread.CurrentThread.ManagedThreadId, Thread.CurrentThread.IsThreadPoolThread }); var tcs = new TaskCompleti

How to support Windows 8 & 8.1 Geolocation API

I've added Geolocation support to my program but I have a problem that I'm not sure how to handle. I'm using VS 2012. I've added a DLL to my solution which makes all of the Geolocation calls. I set the version of Windows supported to 8.1 in the .cspr

Where can I store (and manage) application license information?

I am developing a Windows Application. That requires users to register to use it... Now, I am storing my license info as a file in APpData. But deleting that file resets the trial version date. So, I am now planning to save it in registry. But, Most

How to get a class value from a parent page of iframe

I have two applications one is already built and the other one is my own I can't do any modification in the first one and it uses iframes and in that frame I can put my application but I will need the name of the connected users which the only option

Connect the label to a static string

I have made a Base Form which is inherited by most Forms in the application. Base form contains a Status Bar Control that displays user name which is internally a static string. User can Switch User at any point in the application by pressing a butto

Local user name, unauthorized characters

currently if I try to add local user "jim,bob" to a Windows 7 system, as expected, the following error dialog is shown displaying all the illegal chars for a user name. Is there a quick .net method to call which returns the same chars? E.g. Path

Using the question mark in the regular expression

I am trying to parse an xml but before parsing it I am cleaning some unnecassary attributes from it by using Regex.Replace method of .NET. This is my input <?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-

How to convert boost :: asio socket to C ++ / CLI .Net socket?

What I want is simple - code sample of creating new C++/CLI .Net socket from boost asio socket. How to create such thing? Here is pseudo code of what I would like to do: .net::socket a; boost::asio::socket b; a.assign(b.nativeWin32Socket()); BTW: Her

Error executing Powershell commands using C #

I have the following code that I have tested and works: using (new Impersonator("Administrator", "", #########")) { RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create(); Runspace runspace = RunspaceF

C # / Communication between Async network and GUI

I'm doing async network in C#.NET with the TcpClient and TcpListener classes. I use WinForms for the GUI. Whenever I receive data from a remote computer, the operation is done on a different underlying thread. What I need to do is to update the GUI o

Silverlight: client / server level needed?

I am coming from a WPF / Windows application background and am learning Silverlight/Web. The first thing that really confuses me are the tiers. In Windows applications, you have a clear separation between clients - that need to be deployed on each us

Continue program execution even after trying to capture

When I use try, catch blocks, if any exception is throws the program execution is stopped after the catch is handled. But, I need to continue the program execution even if there is exception. Can any one help me how to do it?If I understand correctly

How to set a baud rate to 10400

Is it possible to set the baud rate to 10400? (Using .Net)You don't need this. Trust me. Even if you think you do, you don't.

Hidden. Adds absolute expiration - based or not on UTC?

The examples for Cache.Add uses DateTime.Now.Add to compute the expiration, i.e. it passes: DateTime.Now.AddSeconds(60) as the value of the absoluteExpiration parameter. I'd have thought that computing it relative to DateTime.UtcNow would be more cor

T in class? AddRange ICollection?

I try to do static class, add to icollection but i got some issues i cant seem to overcome. that is how i get so i can pass a ICollection in the method? cause T is that say it can not be resolved. and then i wonder is there a way to do AddRange on ic

confusion on transactions and msdtc

I have some basic confusion about how transactions and msdtc work together. I have a basic server/client winforms app. The app uses transactionscope to encapsulate several sql commands that are executed on the sql server. The app seemed to work fine

Update before screenshot

I want to capture an image of the screen, however there are some wpf controls in my application that I do not want to appear in the screenshot. Using the code below, the hidden controls will sometimes still appear in the screenshot. How do I ensure t

Bidirectional dictionary 1 to 1 in C #

I am looking for a generic, bidirectional 1 to 1 Dictionary class in C# (2), ie. a BiDictionaryOneToOne<T, S> which is guaranteed to only contain one of each value and key (up to RefEquals anyway), and which can be searched using either key or value