Cast to int on SqlCommand-ExecuteScalar error handling?

I have code that is possibly fragile. This statement here int countDis = (int)cmd.ExecuteScalar(); If I change t...

How do I authenticate a WebClient request??

I am making a call to a page on my site using webclient. I'm trying to get the result of the webpage put into a pdf ...

Why use Attach for update Entity Framework 6??

While searching for the best practivies of performing CRUD operation via EF I noticed that it is highly recommended ...

How to add Text to Speech to Unity project??

I am looking for System.speech to work in unity? Is there any way how to include this DLL in unity and MonoDevelop? ...

Convert XmlDocument to String?

Here is how I'm currently converting XMLDocument to String StringWriter stringWriter = new StringWriter(); XmlTextW...

Project structure for MVVM in WPF?

What is the project structure you end up with when using MVVM in WPF? From the tutorials I saw now, they usually ha...

Code snippet or shortcut to create a constructor in Visual Studio?

What is the code snippet or shortcut to create a constructor in Visual Studio? Visual Studio 2010 and C#. I've use...

Get Cell Value from a DataTable in C#?

Here is a DataTable dt, which has lots of data. I want to get the specific Cell Value from the DataTable, say Cell...

IIS shows 404 but file exists?

I have issue with my app after run it on VPS. I installed IIS on VPS, removed DefaultWebsite, and add another one....

How to create Excel file in asp.net?

I want to create Excel Sheet in asp.net. I have already done code for this and it is working fine in local system bu...

Currency format string in asp.net?

I am using an infragistics webgrid and need to format a currency string. For this I need a string containing a patte...

linq question: querying nested collections?

I have a Question class that has public List property that can contain several Answers. I have a question repositor...

design report using visual studio 2013 report designer - how to begin??

years ago i designed a corporate tool consisting of a sql server 2008 database as backend and an ms access 2007 proj...

Make WPF window draggable, no matter what element is clicked?

My question is 2 fold, and I am hoping there are easier solutions to both provided by WPF rather than the standard s...

Exception handling in Entity Framework?

I have a form that it has some field and has relationship with database. I'm using entity framework I wanna handle e...