.net

Fluent NHibernate with development/test/production databases?

I was wondering if anyone had developed an approach for using NHibernate / Fluent NHibernate with different databases depending on the application's configuration (similar to Rails' development, test, and production databases). I believe I could get something working by using methods with conditional attributes, but I would be intereste...

What's wrong with my ListView Callback retreiving subitems?

I'm trying to retrieve the SubItem in my ListView from another thread, but I keep getting the Item instead of the SubItem. I'm not sure how to code this properly. Below is the code I'm using: Delegate Function lvExtractedCallback(ByVal x As Integer) As String Private Function lvExtracted(ByVal x As Integer) As String Static Dim l...

How to collect network statistics using c# such as Ping ms, Download rate, Packet loss

Hi there, I am thinking of creating an open source application that given a list of high speed download sites/files it can generate a list of calls to these sites in order to form the following statistics. Ping Times Download Rate Packet Loss I was thinking whether or not there are builtin or external libraries in .NET to do that ki...

How can show amount in words in crystal report !

Hello, I m working on windows form application. I need to show amount in words in crystal report. How can show amount in words in crystal report ? ...

Monitoring outgoing internet traffic

Is there a way to monitoring internet traffic programatically? I would like to log the pages users are visiting on the Internet. Can this be achieved with .NET code, is there a 3rd party .NET component that could be used to retrieved data. Information about Internet traffic must be stored to a database so I cannot use a plugin or somet...

Is there any Web RichTextBox Control that supports RTF format?

I'm working on an application that let's people send messages to each other.We have a win application and a web application.So far we are using a RichTextBox control in our windows application that let's people format their text and it's saved as a RTF text in our database.The problem is we don't have such a control in our web app but a ...

Time Delay in C#

The following function System.Threading.Thread.Sleep(); delay the thread in millisecond, and take the integer value as a parameter. Is there any method of thread delay in microsecond. Or can sleep function take the float values? Thanx ...

Is there a binary equivalent of System.Text.StringBuilder?

I'm concatenating a large number of byte[] arrays in C#. If I were doing this for strings, I would use StringBuilder -- is there an equivalent class that would work for binary data in byte[] arrays? ...

Export DBML to SQL script

Due to a harddrive crash, I lost my SQL server database files for a project I was creating. I still have my DBML files I used in my .NET project, so I still have the database structure in a file. Is it possible to export my DBML somehow to a SQL server script, to recreate my databases in SQL server. ...

.NET Framework thread "ancestry"

I am looking for a way to determine for a thread on which other thread it was originally spawned. I do not know whether a mechanism exists to do this, similar to the "Parent" property on Tasks in the new Task Parallel Library for .NET 4 Edit: Further investigation actually seems to indicate that there is no location to store this inform...

COM Exceptions in C#

I am consuming a cpp COM object from c# code. My c# code looks like this: try { var res = myComServer.GetSomething(); } catch (Exception e) { } However the exception never contains any of the details I set in cpp, in particular my error message. In my cpp side I have followed several examples I have found on the web: ... ICreateE...

Font for fast Printing in .Net

What font that can be set in a .Net application for fast printing. ...

Return Enumerable value from Class in linq?

i need Enumarable value from below class but give error public static Enumerable LoadDataByName(string name) { List<StuffDepartman> Stuff = (List<StuffDepartman>)HttpContext.Current.Session["Stuffs"]; var stuffs = from s in Stuff select s; stuffs = from s in Stuff where s.Name = name s...

What should I do when a class name is very common?

I've just added yet another 3rd-party component to my .net project that contains a class called Client and it got me thinking about common class names. Do you name your public classes something as common as Client, or do you try to make the name more specific? In the past I would have said Client was fine, since it can always be access...

How to create .NET-compatible events in F#?

Hi! I am trying to publish an event from an F# type, but I want it to be seen as an event from C# or VB. It seems that the correct way to do it used to be IEvent.create_HandlerEvent, but this function doesn't exist in the newest version of F#. So what is the correct way to do it now? ...

Can I intercept a file upload over HTTP to IIS7 and deny the upload based on a validation criteria?

I have a form which you can post a file over to my server. Is there a way, without using a custom HTTP handler, to intercept the start of the post and prevent it before the file is uploaded and bandwidth used up. So for example, I could check an IP address and if it's blocked in my system I could stop the request before I waste 10MB of...

Change paradigm to use WorkFlow

Was wondering advantages/disadvantages of using WorkFlow in new development? Seems like a bit of change of paradigm, wondering if it is worth the effort to incorporate. ...

Hyperlink in DataGridView - how to have text and links?

Is it possible to have a Windows Forms DataGridView in which one of the columns will display standard text with some words of it as clickable links? Here's what I'd like to do: whenever I get a certain regex pattern in the text, I want to make that match a hyperlink. Any idea on how to implement this? Thanks ...

Linking non-CLR code to .NET app

I'm new to Visual C++, .NET, and the Windows world of programming (coming from Objective-C/Cocoa), and I'm trying to use the CFLite (Open CoreFoundation Lite) library, which I compiled to a .lib file. It's written in pure, unmanaged C, and I'd like to use it in my managed CLR .NET app. When I try to link it and use the function CFSTR, wh...

How do I round a float up to the nearest int in C#?

In C#, how do I round a float to the nearest int? I see Math.Ceiling and Math.Round, but these returns a decimal. Do I use one of these then cast to an Int? ...