.net

Retrieving "invalid" value from a NumericUpDown Validating event

When the user enters a value above numericUpDown.Maximum, the control's value is automatically set to the maximum. I'd like to display a MessageBox when this occurs, but I'm not able to do that because control.Value and control.Text already contain the automatically set value, maximum, when Validating event is raised. private void numer...

Creating a Custom UserControl TestContainer for Visual Studio

I like to use the "UserControl TestContainer" that works great for testing a controls properties during design time. Yet it has limitations. Usually, I just create a Windows Form Application to test the control's run-time interface. It would be nice to combine the two phases. Today, I discovered that the test-container is defined in the ...

Is multithreading the right way to go for my case?

Hello, I'm currently designing a multi-client / server application. I'm using plain good old sockets because WCF or similar technology is not what I need. Let me explain: it isn't the classical case of a client simply calling a service; all clients can 'interact' with each other by sending a packet to the server, which will then do some...

Can I correctly debug assemblies loaded with the 'AssemblyResolve' event?

I'm experimenting with the AppDomain's 'AssemblyResolve' event by hidding the depedencies for an executable file in another folder. The assemblies seem to beloading and executing fine, however debugging seems to be crazy, sometimes it hits my break points, sometimes it doesnt , and sometimes it hits the same code twice(It seems absurd bu...

Custom DataGridView column sort based on Value not Formatted value

I have a custom DGV cell I'm using to display the contents of MyType objects. To control how they're being formatted I'm overriding the GetFormattedValue() and FormattedvalueType methods of DataGridViewTextBoxCell because in this case I don't want to use the default ToString() method. The problem is that when I do this the DGV is sorti...

CLR SQL Assembly: Get the Bytestream?!

I have a SQL CLR dll I want to deploy, but have found you can embed the byte stream/varbinary_literal/ varbinary_expression/assembly bits into a text file to get around the messy hassle of packaging a DLL and making sure it's accessible for the CREATE ASSEMBLY command. But what I have yet to find is how to get that byte stream/varbinary...

Server-based Chat

Described on this scheme "Server Clients Scheme" I try to create a Silverlight / Server Application which has EventHandler/Triggers, which can do the following: Notice whether a message was sent to "it" (the server) Notice that the sent message is new "to all" "except" "the sender" Send "to all" ("except...") "new message can be downl...

DataGridView CheckBox events

I'm making a DataGridView with a series of Checkboxes in it with the same labels horizontally and vertically. Any labels that are the same, the checkboxes will be inactive, and I only want one of the two "checks" for each combination to be valid. The following screenshot shows what I have: Anything that's checked on the lower half, I...

Problem passing ELMAH log id to Custom Error page in ASP.NET

I am using ELMAH to log unhandled exceptions in an ASP.NET Webforms application. Logging is working fine. I want to pass the ELMAH error log id to a custom error page that will give the user the ability to email an administrator about the error. I have followed the advice from this answer. Here is my global.asax code: void ErrorLog_Log...

How to capture a signature from an ePad in C# - windows forms?

I need to save a signature from an ePad device .. I would prefer to use the Microsoft.Ink InkPicture control but the ePad really zoom zooms the mouse pointer about. The ePad SDK samples didn't compile either. Also, I'm a winforms noob. Is there a certain library or sample code that might be helpful? ...

CrystalReports.NET - varbinary blob

Hi folks, what's the proper way to display an image (bitmap) stored in sqlserver 2008 database as an varbinary(max) datatype in CrystalReports for .NET? I have added a 'blobfieldobject' item in crystal reports & it is bound to a datatable with the column of type 'varbinary(max)' but the image won't show up instead a dark background is ...

Will "Programming in the Cloud" Ever Take off?

Just got a chance to try out a cloud programming environment that let's you develop .net apps within the browser (http://coderun.com/ide/) I found it pretty interesting, since I was able to develop a mockup ASP.net site on an IPad. With javascript engines in browsers becoming faster and faster, cheap server infrastructure to compile o...

Using Mercurial (HG) programmatically from C#/.NET

What's the best way to approach using Mercurial (HG) programmatically from C#? I will be creating HG repositories, committing, and using other default HG functions. Are there are open-source .NET libraries that would allow me to do this? Thanks in advance. ...

Can a Snapshot transaction fail and only partially commit in a TransactionScope?

Greetings I stumbled onto a problem today that seems sort of impossible to me, but its happening...I'm calling some database code in c# that looks something like this: using(var tran = MyDataLayer.Transaction()) { MyDataLayer.ExecSproc(new SprocTheFirst(arg1, arg2)); MyDataLayer.CallSomethingThatEventuallyDoesLinqToSql(arg1, argEtc);...

How can I access a data repeater's item by index instead of explicit name?

Right now I'm using the following code in my markup: <asp:HiddenField ID="TheName" runat="server" Value=<%#Eval("SpeakerName")%> /> I would like to use: <asp:HiddenField ID="TheName" runat="server" Value=<%#Eval(0)%> /> I would like to be able to call it by index instead of explicitly by "SpeakerName". Is there a way to do this in ...

What is the relationship between WebProxy & IWebProxy with respect to WebClient?

I am creating an app (.NET 2.0) that uses WebClient to connect (downloaddata, etc) to/from a http web service. I am adding a form now to handle allowing proxy information to either be stored or set to use the defaults. I am a little confused about some things. First, some of the methods & properties available in either WebProxy or IWebP...

Load and execute code from an assembly without locking the file?

Is there a way to load an assembly from disk and execute code in it without getting the file locked on disk? I never understood why it is necessary to lock the file since the code will be loaded in RAM and JIT-compiled? ...

Improving code and UI Performance

I am dealing with a situation that I need some help with here. I need to improve performance on functionality that records and updates UI with user selection info. What my code current does is 'This is called to update the Database each time the user 'makes a new selection on the UI Private Sub OnFilterChanged(String newReviewValueT...

Resources for getting started with Lucene.Net?

I'm building a simple site that allows users to post text content and I want to add it to a search index as it gets posted, so my site search is up to date. From what I can tell Lucene.NET is a good full text search framework. I've found very few examples of how to use it though. Can anyone post some good references for learning about...

Doubt about Scripting.file

How do I create a instance of Scripting.file from a file path? I tried a lot with C# in Visual Studio, but don't know how do. ...