.net

Cannot install .msi package silently

Hi I have an Office 2007 add-in (developed using Visual Studio 2005 Tools for Office Second Edition) which has been packaged into an .msi file, using the Setup project in Visual Studio 2005 The problem is that when the users install the package themselves by using Next->Next->Finish then everything works normally, but when I try to ins...

.NET 1.1 and SQL Server native Client for SQL Server 2005

Hi All, I have a .NET 1.1 application that currently connects to a SQL Server 2000 database server. This SQL Server is about to be upgraded to a SQL Server 2005 server with mirroring enabled. I have been trying to figure out if mirroring (i.e. automatic failover) is supported by .NET 1.1. I know that it is supported through the SQL Serv...

CorfFlags warning CF011 about strong name signed even after /force

Im trying to use Corflags to get PartCover running under x64. When I use: CorFlags.exe PartCover.exe /32BIT+ /Force i get: corflags : warning CF011 : The specified file is strong name signed. Using /Force will invalidate the signature of this image and will require the assembly tobe resigned. without /force i get: corflags : error C...

Difference in months

In C#/.NET TimeSpan has TotalDays, TotalMinutes, etc. but I can't figure out a formula for total months difference. Variable days per month and leap years keep throwing me off. How can I get TotalMonths? Edit Sorry for not being more clear: I know I can't actually get this from TimeSpan but I thought using TotalDays and TotalMinutes wou...

display xml contents in to a listview in winforms

Ihave an xml file sample.xml <?xml version="1.0" standalone="yes"?> <DataSchema xmlns="http://tempuri.org/DataSchema.xsd"&gt; <ManagedObject> <Label>sam</Label> <Owner>00000000-0000-0000-0000-000000000000</Owner> <ClassID>00000000-0000-0000-0000-000000000008</ClassID> <DefaultApp>00000000-0000-0000-0000-00000000000...

Is it possible to set TraceSwitch programmatically mimicking app.config entry?

I am using a third party tool which internally adds trace messages using the following code: System.Diagnostics.Trace.WriteLineIf( new System.Diagnostics.TraceSwitch("Switch", "").TraceInfo, message); In this scenario, it appears that I must add the switch to my app.config file to get the trace messages to appear: <system.diagnos...

Why does specifying a numeric value for a control's property in the designer result in new decimal(new int[] {... in the code?

In my C#.Net WinForm app in VS2005, I have a NumericUpDown control. In the designer, I set the Minimum property of the NumericUpDown to -65535. In the form's .designer.cs code, I expected to see this: this.myNumericUpDown.Minimum = -65535; but instead I get: this.myNumericUpDown.Minimum = new decimal(new int[] { 65535, 0...

File.WriteAllText throws UnauthorizedAccessException

Doing File.WriteAllText to a remote path throws UnauthorizedAccessException. When I open the file in notepad I can edit it without a problem. The process that's trying to modify the file is running as my own user account, so it should be able to access it. ...

PostgreSql + C#:Design Time Support in VS2008

I've installed Npgsql Data Provider for .net and I've executed gacutil -i Npgsql.dll as the user manual said, but I can't use the Dataset designer. When I add a TableAdapter to the designer, It ask me for a new connection, but the options are Access, MS Sql, or SQLite (other dataProviders that already i have installed). There's no op...

Good book about threading in .Net

Hello people!!! Can someone recommend me a good book about threading in .Net, im using the 3.5 framework and working with Visual Basic. Thanks in advance ...

What do you use to create and print forms/documents?

I am not looking to print the screen capture of the UI but a regular form like something you might fill out at the dmv. What do you use to create these forms/documents how do you merge the data into them and print/print preview? ...

Config files containing environment-specific settings

In my organization we have multiple environments (Dev, QA, Stage, Prod, Disaster Recovery) and I would like my app/web.config files to contain no environment specific details in URIs, connections strings, etc. My preferred approach would be to perform run-time substitution, e.g. Instead of this: <endpoint address="http://MyDevWebServer/...

Guidance for Migrating MS Access Apps to .Net Apps

I will soon begin the painful*(kidding)* process of migrating multiple, separate, Access Applications to "Real" applications*(notice the quotes, no flame wars please)*. Most likely this will be Web Apps as the usual reason is multiple users and deployability but I will take it case by case. Some of these are traditional Access apps u...

Linq to sql convert IQueryable to Dataset

What is the easiest way to convert an IQueryable object to a dataset? ...

.NET: User Defined Types in Property Grid Causes Hang

I am developing a .NET 2.0 plug-in based application. My application detects/loads plug-ins at run-time via a System.Reflection inspection of other .NET assemblies in a specified directory. This works great. My application contains a PropertyGrid control populated from [Browsable(true)] properties present in the loaded plug-ins. In t...

Should the base Keyword be used?

When calling methods on a base class from a derived class, should the 'base' keyword be used? It seems using the base keyword would increase code readability but for me so far, when I exclude it, there is no affect on code compilation and execution. ...

Which property stores the controls a GroupBox contains?

I have a GroupBox control that has a bunch of controls inside, but when I use the .Controls property, it's empty. Is there another property that stores these controls? EDIT: Here is the groupbox code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text...

VB.NET COM Server implementing Excel UDF not callable with optional Excel.Range

Versions Excel 2007 (12.0.6425.1000) SP2, Visual Studio 2008 with VB.NET, Windows Vista The windup I have an Excel UDF written in VB.NET that has this signature: Public Function NonExcelName(ByVal A As Integer, _ ByRef B As Range, ByRef C As Range, _ Optional ByVal D As Integer = 1, _ ...

Nested Linq to created multiple class objects

Hello, I am looking to create a dynamic XML navigation menu, which is made of MenuItem's and SubMenuItem's (both classes). I want to parse the following XML and use LINQ to parse it and retrieve the data. Here is a sample XML: <?xml version="1.0" encoding="utf-8" ?> <MenuItems> <Item Id="1" Url="Default.aspx" LinkText="Home" Descr...

Windows Form publish to a different application

Hi, I have a Windows Form application. Version 1 of my app has been released for a while and client is using it. Version 1 of the app is connected to the production database. I have been developing on version 2 of the app and I plan to released a beta version for the client. Version 2 of the app will be connected to the test database, s...