.net

VS2010 Code Analysis for Class level

As you might aware, VS2010 Code Analysis setting works for entire project.. But how can I just do it for selected classes in the project? ...

How does one start and stop services using WMI from .NET?

How would one go about using WMI to start, stop, and query services on the local computer from .NET code? (I'm using C#) I have found good and accurate answers for using the ServiceController class to do this, but I'd like to use WMI if I can. ...

Configuring Sharepoint in .net?

Can you script SharePoint configuration (as in settings done in the "Configure your SharePoint farm" and "Reporting Services Configuration Manager") through .Net ? Does anyone have any links that might help ? ...

Wrapping Text in a rich textbox, but not word wrapping it

Hello all, I have a Windows Form with a Rich Textbox control on the form. What I want to do is make it so that each line only accepts 32 characters of text. After 32 characters, I want the text to flow to the next line (I do NOT want to insert any carriage returns). The WordWrap property almost does this, except that it moves all the te...

What does your company use for database access and mapping? Does this make you happy or sad?

I started out at a medium sized financial firm, and everything was done using a home brewed ORM. I've recently moved to a web shop and it's a mix of ADO.NET and linq to sql. I'm wondering what other people are using at their shops, and why? Are you happy about this, or do you wish you were using another approach? Do-it yourself usin...

Which book for SOA with .net?

The topic of our undergraduate project is SOA. Under this project we are supposed to build 3 service components and one example website that uses those components. I am quite good with Java and have no experience whatsoever with C# or .NET. We have decided to do project in C#.NET. I found SOA with .NET & Windows Azure by Thomas Erl. As ...

How to generate chm from xml without any tools installed?

I am looking for a way to create a chm from assemblies and xml doc files that does not need to have anything installed. Requirements xcopy deployable run from the command line with no UI (although the initial config can be done with a UI) Any recommendations? ...

New project for ASP.NET MVC 3 Beta not including unobstrusive validation Javascript files

My problem today is rather simple, but its driving me nuts! I just downloaded and installed the ASP.NET MVC 3 Beta and created a new project using VS 2010. But when I check the scripts folder, there are none of the following files there! (from what I understood, they should be there): · /Scripts/jquery.unobtrusive-ajax.js · /Scripts/jq...

Generate script Insert in .net

Hi all, I have problem when trying generate script insert with specific condition. So far I am already trying this step. Add references Microsoft.SqlServer.ConnectionInfo and Microsoft.SqlServer.Smo Add reference in code Microsoft.SqlServer.Management.Smo Add this to script. var srv = new Server(@"localhost\SQLEXPRESS"); var db ...

WebHttpBinding in Silverlight 4

I know SL 3 didn't have this but from reading about SL 4, it sounds like it supports WebHttpBinding for REST... But how do I create one in code? I can't find WebHttpBinding anywhere in the ServiceModel.* assemblies for Silverlight? ...

how to convert vb6 to vb.net programmatically

Visual Studio comes with Wizard that converts vb6 code to vb.net. Is there are any way to call this conversion via code? ...

Fastest way to determine two datatables contain same data?

I want to verify that 2 datatables contains same data (for unit testing), but unfortunately, Assert.AreEqual does not work, it seems that each datatable contains unique metadata that makes their references not equal. How can I do this? ...

WPF Close button not working when in Grid

Hello. When I place Button in grid and add to is's click action: this.Close(); It's not working. I want to be able to ask user before exit so I want to use Close(). I don't want to use Application.Shutdown(); How to solve it. ...

open docx in asp.net

I have a requirement of opening the docx file in the browser. Tried with the code below. But error occurs that the file is corrupt. Is the content type correct, tried with thecontent type application/msword also. Response.AddHeader("content-disposition", "inline;filename=" + DisplayFileName); Response.ContentType = "application/vnd.open...

WCF authentication with multiple providers

There is the following design: the back-end implemented as WCF, the public front site and two intranet sites (all three talking to the back-end). I believe that authentication on the sites is not enough (i.e. passing ClientID to WCF in each request as a parameter) and i want to protect my back-end (WCF) with authentication to perform dou...

Ways to measure a systems hardware requirements

Hi, I was wondering if there is a tool to measure the resources needed to run an app? We have developed an app that runs fine on all modern computers, but I am curious about "how low can we go". The app in question is developed in .NET, so there might be some code analyzer or something, but I am more curious in general if there is a to...

C# Compiled lambda expressions instance creation and/or garbage collection?

Consider the following code sample: using System; using System.Linq.Expressions; public class Class1<T, Y> { public Class1(Expression<Func<T, Y>> mapExpression) { GetValue = mapExpression.Compile(); } public Func<T, Y> GetValue { get; protected set; } } public class DataClass { public long Data { get; set;...

Get name tables, name columns, name datas using .net.

How to get all name tables, name columns, and values in database. Example i have database "Northwind" in sqlserver 2005. The name or value may store in collection like System.Web.UI.WebControls.Table or list collection, or other possible accessible. Example: "Customers" as name table, "CompanyName" as name columns, and "" as values in c...

design wise why doesnt 0:00 return 2 digits?

Here is an example. I expected 1900/01/02 but got 1900/1/2 instead. If "1" was an int it would work. Why DOESNT this return 2 digits? i understand its a string but isnt the point of :00 to specify the digits? Why is it being ignored? var date = string.Format("{0:0000}/{1:00}/{2:00}", "1900", "1", "2"); ...

Are there drawbacks to creating a class that encapsulates Generic Collection?

A part of my (C# 3.0 .NET 3.5) application requires several lists of strings to be maintained. I declare them, unsurprisingly, as List<string> and everything works, which is nice. The strings in these Lists are actually (and always) Fund IDs. I'm wondering if it might be more intention-revealing to be more explicit, e.g.: public class ...