.net

VB6 authored ocx on a .NET WinForm?

I've inherited a VB6 project that has a Form with VB controls (Label, etc) and Windows Common controls (Treeview, ImageList, etc), which looks like an ideal candidate for a usercontrol. I mentioned to a colleague the possibility of compiling it as an ocx ActiveX control to be used in a .NET WinForms project. They were slightly horrifie...

Why I need an instance of Odbc reader, but now Odbc connection?

Hi, On the classs level, I have declared: System::Data::Odbc::OdbcConnection conn; System::Data::Odbc::OdbcDataReader datareader; //doesnt work System::Data::Odbc::OdbcDataReader^ datareader //works However, the dataReader has to be OdbcDataReader^. I dont understand why. Thanks ...

How to set Accept-Language header on request from applet

Hi, I'm not familiar with Java but I need to make a request to a remote webservice from within my applet. The webservice (.Net 1.1) uses HttpContext.Current.Request.UserLanguages[0] to determine the language to use. But the value of this member is alway null. So is there a way to pass the Accept-Language header along with something li...

CGAL for .Net ( or C#)

Hello, I am not sure whether there is a .Net version of CGAL? The last time I check there is only one CGAL equivalent in garbage-collected language. If would be tremendously helpful if we have CGAL.net. P/S: I know I can use interop, but still, a full managed version would be better. ...

Remote and automated IIS 7 management from build server - permissions issue

Here's the scenario: Win2003 Build Server (CCNET) IIS7 target deployment server The various MSBuild tasks (Sdc.Tasks, MSBuild Community, MSBuild Extension Pack) for doing this (creating VDirs, setting AppPool properties) are not suitable for at least one or more of the following reasons: No support for IIS 7. No possibility to pass...

How to properly render Control.Enabled = false?

Hi, I have a couple of custom user controls, which may display text, or some other element, and which are custom rendered (by overriding OnPaint). Now, normal .NET controls (such as Labels, etc), grey out, and 'look' properly disabled when the Enabled property for them is set to false. My custom components do not, and still appear very...

Can Nlog store the current Thread user

I am using NLog to provide all my logging, do you know if it is possible to store the current Thread user details, by changing the NLog.Config file? ...

Namespace constant thingy for forward slash

What’s the .net namespace constant thingy for the forward slash "/" So instead of: somePath + "/" + someFile I can do: somePath + .net.namespace.forwardslash + someFile Not really much difference but maybe neater? ...

How can I check a url is publicly accessible?

I have a web application that you can use to import information from another site by giving it a url. It's been pointed out that you could use this feature to access a private site that is hosted on the same web server. So... How can I check that a given url is publicly accessible (whether on the same web server or somewhere different)? ...

Execute .NET 3.0 code from Office 2003

I've created a DLL in C# using the .NET 3.0 framework. Below is the code of my DLL namespace CompanyName.Net { [Guid("F7075E8D-A6BD-4590-A3B5-7728C94E372F")] [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId("CompanyName.Net.Webrequest")] public class WebRequest { public string Result { get; private set;...

How to get high resolution images for Printers in .net?

If you go to "Control Panel\Hardware and Sound\Devices and Printers" in Windows 7 (and i assume vista) you will see some nice pretty pictures of printers. See image below Is it possible to get access to these images through .net? For example to display them on a windows form? ...

How to develop a distributed application in c#

Hi everybody I am going to develop a distributed application and i haven't develop distributed application before so i have many questions in my head so to explain these question I'm going to use a scenario my application will be used in a city called "dreams" in this city there is a building in north of the city called "A". this buil...

Autocomplete text not trigger enter press event after adding the autocomplete data source

Hello, I have a windows application written on visual studio 2008. I have a textbox that has autocompleteMode set to suggest, autocompleteSource set to CustomSource. So I triiger the textchanged event on the textbox to add the autocomplete datasource for the textbox like this: private void txtSearch_TextChanged(object sender, EventArgs ...

Class design: Access a List<T> directly or through methods?

For a newsroom system I have a class that contains a single news story. Inside this class is a private variable holding a generic List of image classes. The idea being a single story can contain multiple images. The question is should I make the List variable public, so that I can add/remove images by addressing the List directly publi...

Best tool to create MSI

Hi, I am new to setup project creation. Now I am using Visual studio 2008 to create setup file (msi) for my project. I am quit uncomfortable in creating my own custom forms in the installation wizard as well as upgrading an existing version of my project to a new version. Is there any other alternatives to create MSI/MSP package for Dot...

Limit rows returned using TableAdapter (typed DataSets)

Does anyone know the best way to limit the number of rows returned when using typed TableAdapters? Options appear to be: Pass "top X" as a parameter (can't do this until we're on SQLS2008 Issue a dynamic SQL statement: set rowcount X before calling my tableadapter method, then set rowcount 0 aftwards. Something else I haven't thought ...

New constructors in .NET 3.5

This is a simple question really. I've been using the new type of constructors in .NET 3.5 (C#), but I would like to know what they're are called, if they've got a name at all :) The constructor I'm talking about is this: Customer c = new Customer() { Name = "Bo" }; ...

How can I split a generic List (of T) based on a property of a list member?

I have a generic List (of Foo) which contains n objects of Type Foo. One of the properties of Foo is PropertyA. PropertyA can be one of ValueA, ValueB or ValueC. Is there an easy way of splitting this into three seperate Lists, one for ValueA, one for ValueB and one for ValueC? I can write some code which loops the original list and add...

Multi-line list items on WinForms ListView control?

Hi there, Is there a way to display multi-line text in standard Winforms listview control? Thanks, Kemal ...

.NET Framework version and COM objects

We have an MFC applcation EXE that hosts COM objects which are the main parts of the application, this is so we can dymanically build in more functionality. Lately new code has been created using C# and made COM visible supporting the same interface. These have all typically been built against V2.X .Net runtime. We now want to be able to...