.net

Load in memory text into WebBrowser control

On the .Net WebBrowser control the only way I can see to load a page to it is to set the URL property. But I would like to instead give it some HTML code that I already have in memory without writing it out to a file first. Is there any way to do this? Or are there any controls that will do this? ...

Case Sensitivity when querying SQL Server 2005 from .NET using OleDB

I have a query that I'm executing from a .NET application to a SQL Server database and it seems to take quite a while to complete (5+ Minutes). I created a test app in c# to try to see what was talking so long (the query should return quickly). As I was reconstructing the query by adding in elements to see which portion was taking so...

Abstracting storage data structures within XPath

I have a collection of data stored in XDocuments and DataTables, and I'd like to address both as a single unified data space with XPath queries. So, for example, "/Root/Tables/Orders/FirstName" would fetch the value of the Firstname column in every row of the DataTable named "Orders". Is there a way to do this without copying all of th...

How to hide a Pocket Internet Explorer element?

How can I hide an element in html on Pocket Internet Explorer running on a Windows Mobile 6 device. The following code does not work even though it apears to be setting the values correctly. function ShowCollapseElement(sLinkId, sContentId) { var oLinkElement; var oContentElement; //Get the elements oLinkElement = document.getElem...

Error sending mail with System.Web.Mail

An older application using System.Web.Mail is throwing an exception on emails coming from [email protected]. Other addresses appear to be working correctly. We changed our mail server to Exchange 2007 when the errors started, so I assume that is where the problem is. Does anyone know what is happening? Here is the exception and stack trace:...

C# .NET / javascript : Collapsable Table Rows - what about this is wrong?

I have a C# .NET page where I want to make rows collapse when a button is pressed. I found many tutorials like this one (http://codingforums.com/archive/index.php?t-90375.html), tried to implement their solutions, but none of them do anything for me when I click my button. To make sure I wasn't going crazy, I made a small test page jus...

How do I share a menu definition between a context menu and a regular menu in WPF

I have a defined MenuItem that I would like to share between two different menus on one page. The menu contains functionallity that is the same between both menus and I do not want two copies of it. Is there anyway to define a MenuItem in the Page.Resources and reference it in the ContextMenu XAML below? <Page.Resources> <MenuItem x...

How to order headers in .NET C++ projects

I'm trying to build a new .NET C++ project from scratch. I am planning to mix managed and unmanaged code in this project. this forum thread IDataObject : ambiguous symbol error answers a problem I've seen multiple times. Post #4 states "Move all 'using namespace XXXX' from .h to .cpp" this looks like a good idea but now in my header f...

Using "Remember Me" functionality for authentication in .NET 2.0

My client wants me to enable a "Remember Me" checkbox when the user logs in. I am encrypting and storing both the username and password in a cookie. However, you cannot write to a textbox when it's in password mode. I've seen this done numerous times, so how are they doing it? thanks in advance! ...

How do I convert HTML to RTF (Rich Text) in .NET without paying for a component?

Is there a free third-party or .NET class that will convert HTML to RTF (for use in a rich-text enabled Windows Forms control)? The "free" requirement comes from the fact that I'm only working on a prototype and can just load the BrowserControl and just render HTML if need be (even if it is slow) and that Developer Express is going to b...

Combining Lists in Lamba/LINQ

If I have variable of type IEnumerable<List<string>> is there a LINQ statement or lambda expression I can apply to it which will combine the lists returning an IEnumerable<string>? ...

.NET File Sync Library

Is there a good .NET file syncing library? It can be pretty basic and only needs to work on local and mapped drives (no server client model like rsync is needed). And yes, I know there is the MS Sync Services, but that is a lot more than what I need. ...

DataGridView's bound table only generates one RowChanged event on a double-click. How do I make it do two?

I have a DataGridView whose DataSource is a DataTable. This DataTable has a boolean column, which is interpreted as a checkbox in the DataGridView. employeeSelectionTable.Columns.Add("IsSelected", typeof(bool)); ... employeeSelectionTable.RowChanged += selectionTableRowChanged; dataGridViewSelectedEmployees.DataSource = employeeSelectio...

Order of items in classes: Fields, Properties, Constructors, Methods

Is there a C# official guideline for the order of items in terms of class structure? Does it go: Public Fields Private Fields Properties Constructors Methods ? I'm curious if there is a hard and fast rule about the order of items? I'm kind of all over the place. I want to stick with a particular standard so I can do it everywhere....

Adding AutoComplete to an Infragisitcs UltraDateTimeEditor control

I'm attempting to modify an Infragisitcs UltraDateTimeEditor control so that the current year and a default time are inserted when the user only enters values for the month and day. The control has an AutoFillDate property, however setting this to "year" seems to overwrite user input entirely. Also changing the InvalidTextBehavior doesn...

Can you catch a native exception in C# code?

In C# code can you catch a native exception thrown from deep in some unmanaged library? If so do you need to do anything differently to catch it or does a standard try...catch get it? ...

How to find out if a Timer is running?

If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick? ...

When ThreadPool.QueueUserWorkItem returns false

The MSDN states that the method returns true if the method is successfully queued; NotSupportedException is thrown if the work item is not queued. For testing purposes how to get the method to return false? Or it is just a "suboptimal" class design? ...

How to create a custom log filter in enterprise library 4.0?

I am using Enterprise Library 4.0 and I can't find any documentation on creating a custom logging filter. Has anyone done this or seen any good online documentation on this? ...

HashSet vs. List performance

It's clear that a search performance of the generic HashSet<T> class is higher than of the generic List<T> class. Just compare the hash-based key with the linear approach in the List<T> class. However calculating a hash key may itself take some CPU cycles, so for a small amount of items the linear search can be a real alternative to the...