.net-2.0

looking for suggestions on complex table header

I would like to have a table header that looks like the image shown below. Could somebody give me suggestions on how I would achieve this. thanks. winform, #c, .net 2.0 ...

Convert stdole.StdPicture to System.Drawing.Icon

I have a COM object (VB6 ActiveX exe) that returns a stdole.StdPicture through interop. Is there a way to convert that to a System.Drawing.Icon? Or is there a better return type for my COM object to return? What I'm trying to do is have my C# code use an icon from my VB6 code. ...

Is it possible to use generic constraints based on attributes rather than types?

I'm trying to write a class that will be in charge of persisting application options. Since the options need to be persisted the values that I'm sent must be serialisable. Initially I thought I've be able to write a method with a signature like this: Public Sub SaveOption(Of T As ISerializable)(ByVal id As String, ByVal value As T) ...

Loading an eml filed saved on disk into a .net Mail.Message object

I have .eml files saved on my hard drive and i'd like to write a .net method that would be along the lines of Sub LoadMessage(byval path as String). How would I go about doing this? I'm using .Net 2.0 - and C# or VB.Net either will work. Would I open a filestream object with the given file? I just don't know how to get it from the st...

What's the correct way to use controls in Owner drawn list box

I am experimenting with owner drawn list box. I am adding a text box to a specific item within list box. However, when I start scrolling, the text box does not display in the right location. What is the right way to do this? Here's the code I am using. Form1.cs using System; using System.Collections.Generic; using System.ComponentModel...

Convince me to move to .net 3.5 (from 2.0)

I am into new desktop app development. I feel at home with .NET 2.0 and c#. I guess I don't need linq, nor care for WPF and other Vista-oid fancy keywords. I also like rather tight and slim 2.0 redistributable, even more for reason it's Vista and 7 included. Why switch to 3.5? ...

How do I set the default target framework in VS2008?

I would like all my project to default to .Net 3.5 when creating a new project, but it initially defaults to 2.0. I've spent a few hours online, and and a few hours digging through project templates. No luck. Can someone please help me out with this? ...

Displaying HTML dynamic buttons

Hi, I am trying to generate a dynamic html button in c#,But buttons are being getting generated when i ran the code.I am trying to generate a dynamic buttons in 2 different ways but none is working out for me. Please let me if anything wrong in code.I tried in page _Load and page_init events.Here is my code i am using it ......... prot...

Fastest way to get a random value from a string array in C#?

What's the fastest way to get a random value from a string array in C# on the .net 2.0 framework? I figured they might have had this: string[] fileLines = File.ReadAllLines(filePath); fileLines.GetRandomValue(); Yes, I know GetRandomValue() is not an actual method, is there something similar that's more or less equally short and sweet...

asp.net send mail

i am writing a program to send mail using asp.net, it gives me an error as the "SendUsing" configuration value is invalid. Here is my code protected void Button2_Click(object sender, EventArgs e) { MailMessage msg = new MailMessage(); msg.To = "[email protected]"; msg.From = "[email protected]"; msg.Subject = "hello"; ...

Developing for Windows Server 2003 64 bit on Windows XP 32 bit

I have been developing an ASP.NET application on Windows XP Professional. While promoting to production I have only now found out that the server is 64 bit. I installed Oracle Client 32 bit on the server and cannot connect to Oracle. I am using the Microsoft Provider for Oracle, and my question is, how do I get an ASP.NET application ...

BeginTransaction not calling BEGIN TRANSACTION

I've got a simple bit of code that uses BeginTransaction(). The resulting transaction is assigned to the connection that I'm using for some sql commands. When I profile the resulting sql, I don't see a BEGIN TRANSACTION at any point. What might be happening that would prevent the transaction from being used? ...

Whats the best way to handle finding items in a list that occured after another?

I have a class like this public class HistoryEntry { DateTime Date{ get; protected set; } HistoryType EntryType { get; protected set; } } public enum HistoryType { Cancelled, Cleared, Redeemed, Refunded } I have an unordered list of these History Entries, and I do Exists statements to see if an entry exists in...

Installation of .Net 3.5 creates problem in ASP.Net 2.0 site

Hi guys, I am working on ASP.Net 2.0 website and I have a strange problem. First let me give you details about my environment. I am using Win XP SP2 Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft .Net Framework 2.0.50727 SP2 Backend is MySQL (uses CoreLab.MySql.dll) Now couple of days back I had to s...

C# 3.0 compatibility on .Net 2.0

What are the C# 3.0 language features we can use in an application that targets .Net 2.0 framework ? PS:I know few like Lambda expressions and var keyword ...

Movable control/panel with using ajax?

I need to create a movable / dragablle panel/control without using ajax and then include it in .net nuke . Can anyone suggest please? ...

What features of .NET 3.5 can be used in a .NET 2.0 application?

I have an app that I am developing in Visual Studio 2008, but the projects are set to .NET 2.0. The application will run on a box that only has .NET 2.0 installed. I understand that I can use some of the features of the .NET 3.5 c# compiler and that it compiles my code to MSIL that .NET 2.0 runtime understands. What are the features o...

C# call a static method at runtime without a build time reference?

I am writing a system in C# .net (2.0). It has a pluggable module sort of architecture. Assemblies can be added to the system without rebuilding the base modules. To make a connection to the new module, I wish to attempt to call a static method in some other module by name. I do not want the called module to be referenced in any mann...

.NET version downgrade generates app.config. Do I need it?

Recently had to downgrade a project from .NET 3.5 to .NET 2.0 because it turns out that the target boxes will not have .NET 3.5 on them. When I did so (in VS2008), it created an app.config file in each project with this snippet of XML: <startup><supportedRuntime version="v2.0.50727"/></startup> Is this necessary? Do I need to ship t...

How can I store C# form element attributes in a text file?

How can I store C# form element attributes (such as position of a textbox) in a file eg. text file? So that when the user opens the form, data is read from the file into the form? I was told I could use an XML config file... can someone please tell me how to do that in C#? ...