.net

How do I launch an application after install in a Visual Studio Setup Project

I have created a setup project using Visual Studio 2008. After the application is finished installing, I would like to have it start up immediately. Any thoughts on how this can be done? ...

Outlook autocleaning my line breaks and screwing up my email format

I'm sending an email using the dotnet framework. Here is the template that I'm using to create the message: Date of Hire: %HireDate% Annual Salary: %AnnualIncome% Reason for Request: %ReasonForRequest% Name of Voluntary Employee: %FirstName% %LastName% Total Coverage Applied For: %EECoverageAmount% Guaranteed Coverage Portion: %GICove...

Output Parameter not Returned from Stored Proc.

I am calling a SQL proc that has 3 OUTPUT params. After the call to the proc one of the params does not return a value when the other two do. Profiler shows that all 3 values are being returned. The params are declared as follows in the proc... @UsrVariableID INT OUTPUT, @OrganisationName NVARCHAR(256) OUTPUT, @Visible bit OUTPUT and...

Excel 2007 Hangs When Closing via .NET

I have a Visual Basic .NET program which needs to open and close an Excel spreadsheet. Opening and reading the spreadsheet work fine, but trying to close the Excel 2007 application causes it to hang. It seems to close, but if you look in the task manager the application is still running. The code that I'm using to close it is wbkData...

Declaring variables - best practices

I found a while ago (and I want to confirm again) that if you declare a class level variable, you should not call its constructor until the class constructor or load has been called. The reason was performance - but are there other reasons to do or not do this? Are there exceptions to this rule? ie: this is what I do based on what I t...

When is memory allocated in the .NET compact framework?

When is memory allocated in the .NET compact framework? If there is a difference between value and reference types, please detail. Documentation or steps to confirm are appreciated. In particular, consider this scenario... private MyClass item; // here? public void MyMethod() { item = new MyClass(); // or here? } ...

Fade between Tab Pages in a Tab Control

I have a Tab Control with multiple Tab Pages. I want to be able to fade the tabs back and forth. I don't see an opacity option on the Tab Controls. Is there a way to cause a fade effect when I switch from one Tab Page to another? ...

C# - Sorting a list when it has more than one value per 'row' ?

Exception: Failed to compare two elements in the array. private void assignNames(DropDownList ddl, Hashtable names) { List<ListItem> nameList = new List<ListItem>(); if (ddl != null) { ddl.ClearSelection(); ddl.Items.Add(new ListItem("Select Author")); foreach (string key in names.Keys) { ...

How do I prevent DateTime from including zone offset in SOAP xsd:dateTime element?

I have this in some WSDL: <element name="startDate" type="xsd:dateTime"/> <element name="endDate" type="xsd:dateTime"/> Which results in the following text in the SOAP envelope: <startDate>2008-10-29T12:01:05</endDate> <endDate>2008-10-29T12:38:59.65625-04:00</endDate> Only some times have the milliseconds and zone offset. This cau...

Has .NET removed the distinction between various languages?

We have always had languages that were preferable to be used in a particular scenario. For a quick prototype development, VB6 was an obvious choice. VB6 was chosen in projects that had a simple desktop user interface and standard and un-complicated database interaction requirements. If you wanted to develop a device driver using low-leve...

Deploy application with SQLExpress

Hi, I've been creating some applications with SQLExpress and find myself, scripting the database creation, tables and other entities etc. after application installation. Is this the normal way? Thanks ...

In DotNetNuke, how can I get a ModuleInfo object if I just have a ModuleId (and not a TabId)

The only method provided by the DNN framework to get a module by ID also required a tab ID. What can I do if I don't have a tab ID? ...

How do I retrieve the version of an Assembly in C#?

I have a reference to a type, for which I would like to retrieve the version number of the Assembly in which it is located. What is the best way to do this? ...

Service needs to detect if workstation is locked, and screen saver is active

I'm working on a service that needs to detect user states for all user(s) logged on to a single machine. Specifically, I want to check to see whether or not the screen saver is active and whether or not their session is locked. This code will run under a system-level service, and has no visible UI, so that may rule out several options (...

APIs in C# for grabbing CPU IDs and drive/volume serial

I'm aware that I can grab the CPU identifier and the volume serial number for a physical drive by querying WMI, but WMI usually takes its sweet time. What other speedier options, if any, are available to retrieve this information? Are there Win32 APIs that would accomplish this? Edit: Allow me to clarify. By CPU identifier, I'm referrin...

What is the best DirectSound specific book for .NET?

I'm looking for the best single book for implementing DirectSound solution with .NET (C# preferred). If I had 1 book to buy, it would be this one. It can be overall DirectX, but I will only care about DirectSound. Also, if there are any good upcoming books about XAudio2, love to hear about that too! ...

Winform create table in RichTextBox control

I need to create a simple editor using a RichTextBox control in a windows forms application that includes the ability to create tables. Is it possible to create a table in a RichTextBox control? If so, any pointers on the best way to do this would be appreciated. ...

Hooking into Windows with C# to Produce Windows 7 New Feature

I just saw a really useful UI feature of the forthcoming Windows 7 ( visit http://www.gizmodo.com.au/2008/10/windows_7_walkthrough_boot_video_and_impressions-2.html and scroll down to the video entitled Super Scientific Video of New Window Resizing Feature) In a nutshell you can drag a window by the title bar to the top of the screen to...

Windows Forms - Multiple Event Loops

I have a Windows Forms (.NET) application that can have multiple documents open simultaneously. It would be convenient to have each document (form) running its own event loop. With brief experimentation, starting several event loops in their own STA threads seems to work. Is there any reason why this is a bad idea? ...

Is there a blocking StreamReader, TextReader, or StringReader in .NET?

I want to run a background task that reads input from a TextReader and processes it a line at a time. I want the background task to block until the user types some text into a field and clicks the submit button. Is there some flavour of TextReader that will block until text is available and lets you somehow add more text to the underlyin...