.net-3.5

Very weird IIS6 asp.net website behaviour

I have a weird issue with my website. This is asp.net(.net 3.5) website hosted on a dedicated server IIS6. Recently I got a strange behavior, the website hangs and just doesn’t reply unless I go to iis and restart either app pool or whole IIS - BUT what is the most strange thing is that in case I go to remote desktop of the server and ...

Is there a way to capture HotKeys/Shortcuts in Excel VSTO using only C# and no VBA?

So I want to capture some key-commands in our Docuement-level Excel VSTO addin. I can't seem to find a way to do it, other than to use VBA and have our addin talk to the VBA. Any help/examples would be greatly appreciated. I am using Excel 2007. ...

what causes the .NET SerialPort class DataReceived event to fire?

I understand from the MSDN docs that the event DataReceived will not necessarily fire once per byte. But does anyone know what exactly is the mechanism that causes the event to fire? Does the receipt of each byte restart a timer that has to reach, say 10 ms between bytes, before the event fires? I ask because I'm trying to write a...

updating values in web.config

I need to store an escaped html string in a key in web.config using the KeyValueConfigurationElement.Save method built into framework 3.5. But when I try to do so, it keeps escaping my ampersands. Code looks like this: strHTML = DecodeFTBInput(FTB1.Text) FTB1.Text is a string of HTML, like this: <b><font color="#000000">Testing</fo...

.NET 3.5: How to remove from list using the 3.5 functions

I have a List with objects. Each object has an ID. I want to remove all the objects which their IDs appear in a given collection. I know that in 3.5 there are functions such as RemoveAll that can facilitate the search and remove. the function's prototype is: internal SomeObject removeFromMe(Dictionary<string, string> idsToRemoveAreThe...

Adding icons in headers for sorting acts weird on Win7 x64 under c# net 3.5

I've spent couple of hours now trying to work out where's the problem with adding icons to header of a listView. The code below works fine on Win 7 32Bit and Windows XP 32Bit. However I've now changed machine to Win 7 x64 and it's been hell with the code. Below code works that when sorting is called on a column it adds icon up or down d...

How to make WCF client use the same data types as the WCF service

I have a .NET WCF service that services only .NET WCF clients (all .NET 3.5, no interoperability, via TCP, binary encoding). Using svcutil.exe the composite types that are used by the data members of the service are generated as part of the proxy.cs class used by the clients. However, what to do if I wanted to reference the same types d...

VS2008 Asp.net 3.5: "Build Page"?

In asp.net how is it possible to perform a "Build Page" on a specific aspx+cs file, and what exacly does it do? and how do I do that because I don't get this option by default when i create a new project. ...

MSMQ - Messages being processed over and over

Hi, We're using MSMQ and an integration mechanism which processes the messages. This mechanism analyzes and validates each message under a transactional context and if validation fails, a rollback occurs and the message is delivered back to the queue. Also, the integration mechanism waits for 20 seconds to process error messsages again....

DataGridView Bound ComboBox Error on values not in the ComboBox datasource

I need to have a DataGridView with a ComboBox column. The DataPropertyName is a text column from a dataset. The combobox contains a few values (in a separate dataset) that the user should be able to select, the displaymember and valuemember is the same column. Now, my problem is that the table beeing edited contains some values in the...

Set app.config value to Environment.UserName

I have an Exception Handler that email our Help Desk software whenever there is an error. All properties for the Mailer are handled in app.config. One of which looks like this --> <add key="from" value="[email protected]"/> Is there a way to have the value set to Environment.Username + '@ourcompany.org. As a side note this ...

How to make visible RegularExpressionValidator?

Hi, I would like to raise error by myself and use reqularexpressionvalidator to show it's text. (My idea is to reuse this control.) I don't remember what property should I use, and what to assign to show the message from control. Can anybody help me please? How to raise error for this control from code? ...

How to know which rar is first in multi rar archives using SevenZipSharp/Unrar in C#?

I am trying to use SevenZipSharp or/and Unrar library in C# WinForms .NET 3.5. I have this problem with multi rar archives that have diffrent naming for example: .rar, r01, r02, r03 and so on (this is easy) somefile01.rar, somefile02.rar, somefile03.rar .001, .002, 003 and so on. If i point Unrar or SevenZipSharp to wrong archive it ...

A Linq to Sql - Multiple .DBML files or one .DBML File

I am working on a web application using ASP.NET 3.5. The application has hundreds of tables. I was told in a seminar that I should use one .DBML file for the entire application instead of using multiple .DBML files (there was also a post in stackoverflow that said the same thing). Given that I have so many tables does using one .DBML f...

Multilingual MessageBox in C#

I have to make a multi-lingual desktop application in C# 3.5. I know how to add multilingual text for labels at design time. But I am unable to find how to make Messagebox and Confirm dialogs multilingual? Do I have to add if/else conditions in code to check the selected language? Thanks in anticipation! ...

Replacing SqlDependency with manual code

We work in .Net 3.5, and we have SqlDependency in the code, which requires the .Net user to have CREATE permissions and other permissions. The DBAs here want to avoid giving the .Net user such vast permissions. Is there a way to bypass SqlDependency by manually doing what SqlDependency does? Running a background process with more per...

An attribute argument must be a constant expression is there a way around this in C#?

I'm working on a code (WinForms C# NET 3.5) that involves using unrar. [DllImport("UNRAR64.DLL")] private static extern IntPtr RAROpenArchive(ref RAROpenArchiveData archiveData); [DllImport("UNRAR64.DLL")] private static extern IntPtr RAROpenArchiveEx(ref RAROpenArchiveDataEx archiveData); [DllImport("UNRAR64.DLL")]...

Creating something similar to System.ServiceModel.Syndication using .NET 3.5

If I am dealing with several standard xml formats what would be the best practice way of encapsulating them in C# 3.5? I'd like to end up with something similar to the System.ServiceModel.Syndication namespace. A class that encapsulates the ADF 1.0 XML standard would be one example. It has the main XML root node, 6 child elements, 4...

Unable to find a converter that supports conversion to/from string for the property of type 'Type'

I'm writing a custom config class in C# and .NET 3.5. One of the properties should be of type System.Type. When I run the code I get the error mentioned in the title. [ConfigurationProperty("alertType", IsRequired = true)] public Type AlertType { get { return (Type)this["alertType"]; } set { this["alertType"] = value; } } The ...

How to void overlap of 2 images when drag and drop in C#?

I want to drag and drop images in a panel and want to avoid overlap of images.The images are dragging from another panel and I want to build a layout from that images. I was able to drag and drop images to the panel and want to avoid overlap when dropped. private void panel1_DragDrop(object sender, DragEventArgs e) { ...