.net

How can I programmatically scroll a WPF listview?

Is it possible to programmatically scroll a WPF listview? I know winforms doesn't do it, right? I am talking about say scrolling 50 units up or down, etc. Not scrolling an entire item height at once. ...

How to make an ASP.NET TextBox fire it's onTextChanged event fire in an AJAX UpdatePanel?

I am trying to get an textBox to fire it's onTextChanged event every time a keystroke is made rather than only firing only when it looses focus. I thought that adding the AsyncPostBackTrigger would do this but it's still not working. Is what I'm trying to do even possible? The code is below: <%@ Page Language="C#" AutoEventWireup="tr...

What .NET collection provides the fastest search

I have 60k items that need to be checked against a 20k lookup list. Is there a collection object (like List, HashTable) that provides an exceptionly fast .Contains() method? Or will I have to write my own? In otherwords, is the default .Contains() method just scan each item or does it use a better search algorithm. foreach Record item i...

Learning NHibernate

I am interested in learning NHibernate. So, I found this: http://www.summerofnhibernate.com/ I would like to watch these, but I am afraid that the videos are for a previous version of NHibernate. Is this true and if so should I still watch them? Is there a current video series? Any other suggestions for learning NHibernate? ...

Get the area of a PictureBox which is covered by a panel

I have two controls which are both contained within a user control. Panel location: 49, 400 Panel size: 787, 70 Picturebox location: 25, 0 Picturebox Size: 737, 700 Picturebox is seen underneath panel. I could use some advice on the best way to determine the area of the PictureBox image covered by the panel, so I can copy the...

How to create SQL Server table schema from a XML schema? (with .NET and Visual Studio 2008)

I have a XML schema, and I know that "xsd.exe" can generate the C# code for it. But I want to know if is possible to automatically create the MS SQL Server 2005+ tables from the XSD, with the help of this or other tools. BTW I didn't get what the C# code generated by "xsd.exe" is worth for. What's the difference between code generated b...

.Net Transforming large XML docs with XSL

Question: What is the best way to transform a large XML document (>200MB) using XSL in .Net? Background: I have a application that feeds me large data files, I cannot change the format. In the past I have been able to translate smaller data files with no issues. Originally I was working with the XML as strings and was running out of ...

ASP.Net Application Cache for Web Services

I have a web service with some data that I need to pass across sessions. I was thinking of using the application object. 1) Is this a good idea? 2) Some of the data will grow old and I'd like to purge it out so that the application object doesn't constantly grow. What is the best way to do this? Thanks ...

When to dispose wcf object with async pattern

Supposing I start off with the synchronous version: using(var svc = new ServiceObject()) { var result = svc.DoSomething(); // do stuff with result } I wind up with var svc = new ServiceObject(); svc.BeginDoSomething(async => { var result = svc.EndDoSomething(async); svc.Dispose(); // do stuff with result },nu...

How to recognize special chars in c# (eg = + ! $ %)

This doesn't work: string a = "="; Regex oper = new Regex(@"[=-*/+]"); if (oper.IsMatch(a)) Console.WriteLine("operator"); else Console.WriteLine("yt"); I don't know whether I'm defining regex incorrectly or I'm missing something. Suggestions? ...

Project Layout (on disk) in Visual Studio

What's the best way to manage the physical layout of a Visual Studio project on disk? I'm getting to the point where I have several folders but I can't really continue categorizing the way I am now. For example, I have several custom controls, but sometimes those controls have to do with application settings, so do they go into the Contr...

How can I convert a string into datetime in .NET?

How can I convert dates like "Jun 17 2009, 03:37 pm ET" into a DateTime variable using C#? I have tried DateTime.ParseExact but I haven't figured out the correct format to use. ...

[WinForms] How to determine which control is eating my keyboard events

In my .Net app, I keep running into the issue of a particular form/control which I expected to receive a keyboard event does not actually receive it. My debugging of this has not progressed much beyond caveman, eg setting breakpoints in all my controls, and seeing who ate a keyboard event that shouldn't have. There must be a better way...

Label.Text change being blocked?

I am attempting to use a Microsoft.SqlServer.Management.Smo.Restore object to restore a SQL Server 2000 database. Just before I begin the restore operation, I change the text of a label so that the user knows what is going on. However, the changed text isn't visible on the GUI (i.e., the text remains the same as it was) until AFTER the f...

Reshaping the "glass" in Windows Vista

In Windows Vista, all standard window borders are translucent with some sort of a glass distortion effect on whatever is under them. This glass effect can permeate other areas of the window--such as surrounding the address and search bars in Windows Explorer or the playback controls in Windows Media Player. What if I want to do this in m...

Rails v1.2.3, ActionWebService and .NET platform as client

I'm using Rails 1.2.3 on a project. ( Upgrading rails is not an option ). I've created a simple test web-service using Rails. I've tested using the Rails invoke scaffold. It seems to generate the response with no problems. I'm trying to setup a client via .NET. I've created an ASP.NET Web App project in C#. I am adding a "Web Reference"...

How to read string literals and comments from a text file?

We are taking input from a text file. Every line is split in strings at white spaces, so we can further classify the elements. Making the string the problem is, that I also want to read string literals (e.g. "Thank you") as they are without splitting and comments too (both // and /* ....*/). Is there any way I can do this? ...

why do people use .net for web development

I just want to know why people use dot net over something like php for web dev. What are the advantages? Is it true that .net generates your javascript and html? ...

How can I rethrow an Inner Exception while maintaining the stack trace generated so far?

Duplicate of: http://stackoverflow.com/questions/57383/in-c-how-can-i-rethrow-innerexception-without-losing-stack-trace I have some operations that I invoke asynchronously on a background thread. Sometimes, things go bad. When this happens, I tend to get a TargetInvocationException, which, while appropriate, is quite useless. What I ...

.net Split by length

I have a string value that its length is 5000 + characters long , i want to split this into 76 characters long with a new line at the end of each 76 characters. how woudld i do this in c#? ...