.net

Looking for a good HTML parser that will provide offsetHeight like values

I have a project which requires me to load an HTML document as a string, and parse it. I am trying to determine which HTML node will exceed the height of a page (8.5x11) so I can insert a ‘page-break-after’ before it. This will be done with a .NET dll I am producing. I have tried using the mshtml dom. It’s not easy to load a string valu...

Workflow as WCF Service Unexpectedly stops

We have a .Net 3.5 Workflow hosted as a service that sometimes stops unexpectedly. This has occurred at times while it is writing a file and, most recently, when receiving a reply from another WCF service. There are no exceptions being caught, as these all get logged, and there are no messages in the event logs on the server where both...

[C#] TcpClient - waiting for data to become available.

In my C# application, I have a thread which basically continually reads from a TcpClient until told to stop. I use WaitHandles for this purpose, for example: private ManualResetEvent stopping; private void Receive() { while (!this.stopping.WaitOne(10)) { while (this.client.Available > 0) { // Read an...

Is there a way to automatically override ToString() on a class?

I find it useful to override ToString() on many of the simple DTO/POCO classes I write to show some good information when hovering over instances within the debugger. Here is one example: public class IdValue< T > { public IdValue( int id, T value ) { Id = id; Value = value; } public int Id { get; priv...

How do I style a submenu of a ContextMenu in wpf

I can style the contextmenu (.style) containing the items and I can style the menu items fine (.ItemTemplate). But how do I style the submenu that pops out when a menuitem has menuitems? Like: <ContextMenu> <MenuItem Header="Font Style"> <MenuItem Header="Under Line" IsCheckable="true"/> <...

Is it possible to modify PDF Form Field Names?

Here's the situation. I have a PDF with automatically generated pdf form field names. The problem is that these names are not very user friendly. They look something like : topmostSubform[0].Page1[0].Website_Address[0] I want to be able to change them so that they are something like WebsiteAddress. I have access to ABCPDF and I have...

DBConcurrencyException happening on second delete

My code keeps throwing a DBConcurrencyException ("Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.) when I make a second update to the data table. The problem actually happens on a table that is linked to a parent table. The two tables, CashReceipts and CashReceiptsApplyTo are displayed on the same winform,...

Silverlight localization with reactive framework. How to?

So, what is a best approach to implement silverlight localization with Reactive Framework (Rx) to achive on-the-fly UI changing? I would be very much obliged for examples. Here is an example of on-the-fly UI changing. But I can't figure out how it works. ...

Registry Access in ASP.NET Application running on Windows 7

I've migrated an ASP.NET web application from Server 2003(x86) to a Windows 7(x64) machine. The web application cannot find registry values that were stored under: SOFTWARE\SomeApplicationName\SubLocation\SubLocation2 being accesed through the Registry.LocalMachine.OpenSubKey api located in the Microsoft.Win32 namespace. My question...

.NET/ADO.NET: Detecting Connection Pool Limits

I am getting connection timeouts and I suspect they may be caused by a bug that is allowing me to exceed my connection pool limit. Is there a way to progamatically detect this? ...

OpendID security tips for Asp.net

Hello, I am just starting with OpenID in an Asp.net MVC application and was wondering what some of the pitfalls are when using OpenID. The reason why I am asking is because I read a lot of warnings when using some OpenID implementations. Mostly it's something like "Don't use that library! You just need to change one word in the url and ...

SQL Query: DELETE all rows except for the xx most-recent

I'm writing a script to check RSS feeds on regular intervals and need to prune out old articles. I came across this answer which seems really close to what I'm looking for: http://stackoverflow.com/questions/578867/sql-query-delete-all-records-from-the-table-except-latest-n I need a similar solution that works the same way, except it k...

Get RemoteApp taskbar icon to flash

I'm using FlashWindowEx to flash the taskbar icon of a .NET application. If I run the app from my local desktop, the flashing happens correctly, but if I'm running the application as a RemoteApp, the taskbar icon doesn't flash -- probably because the app is actually running on the server (even if it looks like it's running on your local ...

CDC and ETL help/recommendations

Here's the background. We have a few different customers, each with a different backend source database. We want to be back to pick up real time changes to the backend database, then transform the data to a target schema in our target database. After that broadcast a message to other apps alerting the change. To do this we need CDC s...

How can i give access to IIS_WPG user role in IIS

How can i give access to IIS_WPG user role in IIS. I am trying to run .net 2.0 application on windows xp laptop ...

Is Guid considered a value type or reference type?

Hi folks, Guids are created using the new keyword which makes me think it's a reference type. Is this correct? Guid uid = new Guid(); Are Guids stored on the heap? ...

what is relation between GC, Finalize() and Dispose?

GC is for managed objects and Finalize is for unmanaged objects thats what I have been reading. Dispose is implicit and Finalize is Explicit is what I have been reading. Can somebody give me one example of one module in which all three thing have been used for different reasons? ...

Fuslogvw.exe tool for .Net does not show UI

I'm trying to use fuslogvw.exe on a Win 2008 R2 system. It shows the process started and using CPU but no UI appears. I've tried the 32bit and 64bit version in and not in admin mode but no luck. I don't see anything in the event log as a problem. ...

Comparing strings with tolerance

Hi! I'm looking for a way to compare a string with an array of strings. Doing an exact search is quite easy of course, but I want my program to tolerate spelling mistakes, missing parts of the string and so on. Is there some kind of framework which can perform such a search? I'm having something in mind that the search algorithm will r...

How to convert string to integer in C#

How do I convert a string to an integer in C#? ...