.net

Is it possible to set a checked listview item to mixed state?

The CheckBox control exposes both boolean Checked and System.Windows.Forms.CheckState enum CheckState properties, which allow you to set the control to either checked, unchecked, or mixed state (Indeterminate enum value). I want to set a ListView item's state to Indeterminate, but only the Checked property seems to be available. So, is ...

Access Textbox from JQuery

I'm new to .Net and JQuery and are trying to access a textbox through jquery but can't get it to work, can someone help? ...

Dependency injection - Place logic in the overloaded constructor?

Today I've got this class: public class SmtpEmailProvider : IMessageProvider { private readonly SmtpClientWrapper _smtpClientWrapper; public SmtpEmailProvider(SmtpClientWrapper smtpClientWrapper) { _smtpClientWrapper = smtpClientWrapper; } To be able to mock the SmtpClient, I've wrapped it like this: public c...

Sort DataTable rows by length in c#.

How to do following scenario: I have some DataTable which contains for example some rows: 1.rowa 2.rowab 3.row 4.rowaba ... n. rowabba How to sort rows by lenght, not by name. I wan to to sort Table by length of fields. ...

How to import / export user account in Reporting Services?

There is a table [ReportServer].[dbo].[User]. But what is the relationship with other tables? And how can I generate the values inside? ...

Event-log messages gets expanded when unhandled exceptions are handled by ASP.NET

If I throw an unhandled exception from ASP.NET, a warning is added to the eventlog (as expected). But if the message in the exception contains a %, the message in the eventlog gets garbled: If the Message was Could not find foo%20bar the eventlog will read Could not find foohttp://localhost/testpage.aspxbar Other numeric values...

C#/.NET: What is the best way to combine a path and a filename?

What is the best way to combine a path with a filename? That is, given "c:\foo" and "bar.txt", I want "c:\foo\bar.txt". Given "c:\foo" and "..\bar.txt", I want either an error or "c:\foo\bar.txt" (so I cannot use Path.Combine() directly). Similarly for 'c:\foo" and "bar/baz.txt", I want an error or "c:\foo\baz.txt" (not "c:\foo\bar\baz...

Is basicHttpBinding really required when exposing a WCF service as a Web Service for .NET 2.0 Target Client?

I have a WCF service and am hosting it in a Windows Service. I tried to add a reference for the service from a Windows Form client built on .NET 2.0. I could get the Web Reference by pointing to the httpGetUrl="http://localhost:8002/HBAccess/help/mex" but when I check the Reference.cs---It only contains a namespace with nothing in it. ...

Limit number of lines in .net textbox

I am using the winforms textbox with multiline option ON. I want to limit the number of lines that can be entered in it. User should not be able to enter lines more than that. How can I achieve that? ...

Exception Handling Application Block Exception Handler running in ASP.NET cannot call Response.End()

Using .NET 3.5, ASP.NET, Enterprise Library 4.1 Exception Handling and Logging blocks, I wrote a custom exception handler to display a standard error page, as follows: [ConfigurationElementType(typeof(CustomHandlerData))] public class PageExceptionHandler : IExceptionHandler { public PageExceptionHandler(NameValueCollection ignore)...

How to convert wiki markup to RTF?

I'd like to create some formatted text in a .net RichTextBox control. It seems like a lot of hassle to use the existing mechanism for formatting, e.g. selection etc. Some kind of markup would be much easier. I.e. just like markup works in this site. E.g. Some **bold** text. gives you "Some bold text". Does anyone: know if anything...

Semi-transparent panel background

Hey, I have a panel which sits on top of a control that renders video. I have controls (buttons, etc), on that panel which I want to be fully opaque. Now, creating a transparent panel background is doable, by overriding the CreateParams property. However, how to I make a panel with a semi-transparent (~50% opacity) background, while k...

Is there any method to clean the website unused resources

Is there any method to clean the website unused resources like... CSS that are no more used in the website skins that are no more than in the website images that are no more than in the website Javascript function that are no more used in the website this thing require, when website is completed and ready for deployment. ...

How to make your software able to run only when the original CD is present in CD Drive

How can I restrict my .net based windows application to run only when the original CD is present in CD drive. Also the user shouldn't be allowed to create copy of CD. ...

How to save XML from WebBrowser control?

I have a WebBrowser control that displays XML from database. Users are allowed to edit that XML inside WebBrowser control. But when i want to save that xml back to database, i don't know how to get modified XML from WebBrowser. I can only see some html in Document property, but no XML. ...

Flex/.NET: Simple chat application using FluorineFX

I'm trying to create a very simple chat application in Flex/.Net using FluorineFX but can't get it to work. <mx:VBox width="100%" height="100%" xmlns:mx="http://www.adobe.com/2006/mxml"&gt; <mx:Style source="../../../Monkeywrench.css"/> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.rpc.events.FaultEvent; impor...

Memory profiler for .NET Compact Framework

Is there a tool I could use for profiling (memory) a .NET compact framework 3.5 application (Windows Mobile)? Thanks! ...

How do I check whether a given USB device is plugged in?

Our winforms application supports a custom controller using the manufacturer's SDK, but there's no support to detect whether a device is present or not. How do I check whether a given USB device is plugged in? ...

Equivalent to C#'s "using" keyword in powershell?

When I use another object in the .net-Framework in C# I can save a lot of typing by using the using directive. using FooCompany.Bar.Qux.Assembly.With.Ridiculous.Long.Namespace.I.Really.Mean.It; ... var blurb = new Thingamabob(); ... So is there a way in Powershell to do something similiar? I'm accessing a lot of .net objects and...

Java vs C#: Are there any studies that compare their execution speed?

Taken out all the obvious caveats related to benchmarks and benchmark comparison, is there any study (an array of well documented and not biased tests) that compares the average execution speed of the two mentioned languages? Thanks ...