.net

Winforms generated events and removing the handlers

When creating form windows, often there are situations where a particular event was added and the program comipled.However later u realize that the event is not really required and so remove the event. Now when u compile the code again an error is displayed. For example in the code I have written: WindowsAplication1.LanMessenger does not...

STArtThread

HI All i'm completing a sample Project(WPF) to show my boss but i need a feature to finish it. I have a Login Window to authenticate and access in the software now i wish put this LoginWindow as STArtThread so if the user can authenticate(with right password and username) automatically the LoginWindow disappear and can access to use the...

Populate large data from database.

I have develop 3-tier application and I have issue about populate data from database. My application has some window that query large data from database and this process take a very long time. (My client is so far from server and connection between it is 128 KBS) Then I have think for the solution to solving this problem. The solution is...

Need to embed Excel worksheet in .NET application

Hi, I need to embed an Excel workbook/worksheet in a .NET WinForms application. So far, i have found only one way of doing it - by adding a Web Browser control to the application and navigating to an Excel file using this control. This is a very cumbersome solution. Is there an easier way of doing it? Thanks! ...

What is the limitation of PerlNet?

Hi everyone, I've used PerlNet for a data extraction project. Perl is a powerful language for extracting data and text manipulation with a huge CPAN module. However, my program need some kind of UI, thread... which I decided to use .NET C#. With Perl Dev Kit, we have an option to wrap an Perl module to a .NET DLL and use this DLL direct...

i want to capture a string through regex only when it contains any alphabetic characters?

example strings 785*()&!~`a ##$%$~2343 455frt&*&* i want to capture the first and the third but not the second since it doesnt contain any alphabet character plz help ...

Why is there no generic version of HybridDictionary?

Apparently there is no generic version of a HybridDictionary. Why is this? I always considered it to be a best-practice when you needed to store items in a dictionary, but didn't know how many items were going to be in it. Maybe because the Dictionary<> has better performance and less overhead than the HybridDictionary, even with only ...

C#: How can I combine a switch with an if-statement?

I need to combine a switch with an if-statement. How can I do that? I want to do something like this: switch (periodtype) { if(starttime>endtime) { ; } else { case 0: nextRunTime = nextRunTime.AddHours(period); break; case 1: nextRunTime = nextRunTime.AddMinutes(period); break; case 2...

Peer Learning Topic Suggestions

Every Friday we have a half-hour peer learning session, where on a rotating basis, we all get a turn to give a short, introductory presentation on technology we feel we know and could benefit our colleagues knowing. I know everything ;-), so I'd like some ideas on what I could present. What I mean to say, is that I don't really have an...

"Good" ASP.net Stack Traces in Release Configuration or how to get the offending code

If I have an application running on ASP.net and I have debug and stacktrace enabled in web.config, I get a really nice Error Screen telling me exactly which code caused the error. Sadly on a live system where debug is set to false, the yellow screen of death is quite unhelpful, even with stack trace enabled, it does not show the line wh...

How can i learn mytime pre midnight or after midnight?

i send any function a datetime is_PM_AM("23:00.00") if it is pm ,it must be return true or else? But how? mytime ="23:30:00" function(Datetime mytime) { if (Datetime.midnight < mytime) { return true; } else return false; } Can you help me? ...

Get RTF from RichTextBox

How do I get the text in RTF of a RichTextBox? I'm trying to get like this, but the property does not exists. RichTextBox rtb = new RichTextBox(); string s = rtb.Rtf; This does not work :S ...

What causes a WPF ListCollectionView that uses custom sorting to re-sort its items?

Consider this code (type names genericised for the purposes of example): // Bound to ListBox.ItemsSource _items = new ObservableCollection<Item>(); // ...Items are added here ... // Specify custom IComparer for this collection view _itemsView = CollectionViewSource.GetDefaultView(_items) ((ListCollectionView)_itemsView).CustomSort = n...

Data Binding POCO Properties

Are there any data binding frameworks (BCL or otherwise) that allow binding between any two CLR properties that implement INotifyPropertyChanged and INotifyCollectionChanged? It seems to be it should be possible to do something like this: var binding = new Binding(); binding.Source = someSourceObject; binding.SourcePath = "Customer.Name...

.Net 3.5 Chart Controls Exception

I am using the new free .net chart controls and they appear to work fine when I run the project up in visual studio, but when hitting the same via IIS I get and exception: [HttpException (0x80004005): No http handler was found for request type 'GET'] System.Web.HttpApplication.MapIntegratedHttpHandler(HttpContext context, String requ...

Reading monochrome bitmap pixel colors

I don't know a better title, but I'll describe the problem. A piece of hardware we use has the ability to display images. It can display a black and white image with a resolution of 64 x 256. The problem is the format of the image we have to send to the device. It is not a standard bitmap format, but instead it is simply an array of by...

Recommended Prism v2 Silverlight/WPF Project Structure

I'm currently tasked with teaching all the developers, in the company I work in, about Silverlight (v2). The only problem is that I don't have any real Silverlight experience myself. Of course I've studied all the technical details about stuff like databinding, layout etc. so I can help my colleagues. But one thing that is hard to find a...

What is your most used .NET namespace?

What is your most commonly used namespace in .NET? I know it will vary greatly based upon the types of projects you develop, but the Stack Overflow audience should provide a fairly decent sample set for the types of .NET projects being developed. I'm simply interested in the name of the namespace (one namespace per answer and no one sh...

how to transition from traditional app development to web development?

I'm in a bit of a career quandry here. I currently live in an area of the UK which is reasonably good job wise for C++ desktop application developers (i.e like me) however my wife is being relocated to an area of the country which is near to a major tech hub of the country, but not near enough to commute on a daily basis (i've done 2 hr....

StringWriter or StringBuilder

What is the difference and when should I use one or the other? ...