.net

Library or Code Snippet for AutoComplete in Text Control based on the previous user entered values

I'm looking for a library for Autocomplete support in text controls which remembers all previous entries of the user and provide auto-complete support for it. For example for "recent files" I use http://www.genghisgroup.com/ and it works great. Do you know something like that for this purpose? UPDATE : This is a .NET Winforms applicati...

Rewriting a Url which can contain 1 or 2 querystrings with URLRewriter.NET ?

Hi, In my project, my /PropertDetail.aspx can get 2 querystrings. 1st one for the PropertyId /PropertDetail.aspx?PropertyId=5 2nd one for the Language /PropertDetail.aspx?PropertyId=5&Language=2 EDIT: and this page can get one of them or can get both of them, so my rewriter rule needs to handle both of them So, i have set these ru...

LINQ to SQL - Grouping by hours

Hi, How can I group result of a LINQ to SQL query by hours considering that the column type is DateTime? ...

Implementing a custom TraceListener in .NET

I am looking for best practices to implement a TraceListener that will write logs inside SQL server from an ASP.NET application. What are the things that should be taken into account when implementing such a class in order to avoid performance reduction? Will stored procedures be faster than plain ADO.NET INSERT statements? I reall...

Assigning Roles to Users

I'm having trouble figuring out how to assign roles to users. I've got the log in mechanism working, but need to figure out how to use roles defined to give users certain access. I have a database with these tables: Tables ------ UserTbl RolesTbl UserInRoleTbl ------- ...

Update .NET Compact Framework - when?

As many of you know, in Barcelona last week at the Mobile World Congress, Microsoft presented a "beta" of Windows Mobile 6.5 which will probably be launched later on this year. I have been reading a lot of articles on the web about this congress and the new features of Windows Mobile 6.5 but nowhere have I found any indications if the ....

Visual Studio 2008 Build Dependency Chain

I am having an issue with Visual Studio 2008 SP1. Basically, I have a .NET 3.5 solution with a client, shared and server component. While coding, all components run on the same box, but in production the server component is a standalone (remoting) service running on a separate server. I would expect that a change to the client component...

C# :httpwebrequest

I am trying to set value of referer parameter of httpwebrequest header, but it is giving error- Function that I am using (C#): webRequest.Headers.Set(HttpRequestHeader.Referer, "http://www.microsoft.com"); Error: Invalid parameters. A required parameter is not found or contains invalid value. ...

How can I convert formatted text on a webpage and in the database to RTF or doc.

I have some formatted data that needs to be saved from the web page as a word document or rtf, something ubiquitous so I am thinking RTF. What is the easiest way to save something from .net as rtf? Are there built in tools for this or some plugins? ...

Why isn't my public property serialized by the XmlSerializer?

This is one i struggled with for ages so thought I'd document somewhere. (Apologies for asking and answering a question.) (C# .net 2.0) I had a class that was being serialized by XmlSerializer, I added a new public property however it wasn't being included in the output XML. It's not mentioned in the docs anywhere I could find, but pu...

URL Encoding using C#

I have an application which I've developed for a friend. It sends a POST request to the VB forum software and logs someone in (with out setting cookies or anything). Once the user is logged in I create a variable that creates a path on their local machine. c:\tempfolder\date\username The problem is that some usernames are throwing "Il...

Confusion about streamwriters and how compression works

Before I begin, is it possible to write a .doc file with mixed content using a streamwriter? For example, I may have a .doc file with images and text - would a streamwriter be suitable for this? I assume a textwriter is for writing a text only document. What I am trying to do is compress a file (format not known), which is easy enough. ...

major.minor.build.revision versioning style vs year.month.day.whatever versioning style

Is there any reason to use one versioning style over the other for .NET assemblies???? I'd like to know if there are any advantages/disadvantages in using either style besides taste. ...

Asynchronous operations performance

One of the features of asynchronous programming in .NET is saving threads during long running operation execution. The FileStream class can be setup to allow asynchronous operations, that allows running (e.g.) a copy operation without virtually using any threads. To my surprise, I found that running asynchronous stream copy performs not ...

How To Retrieve "AverageValue" Performance Counter?

Hi Guys, I am trying to retrieve windows performance counter and display it in ASP.NET page. However, I am having dificulty to retrieve the average type of counter. Say, I want to retrieve counter like how many page request per second? I have no idea to calculate that value, since the PerformanceCounter class only give me RawValue and...

Connecting a button and a text box in Visual Basic

I'm stuck on this exercise that asks me to create a text box and a button. Each time the button is pressed it is supposed to add 1 to the text box. Anyone know how to approach this? ...

.net collection for fast insert/delete

I need to maintain a roster of connected clients that are very shortlived and frequently go up and down. Due to the potential number of clients I need a collection that supports fast insert/delete. Suggestions? ...

Logging best practices

I'd like to get stories on how people are handling tracing and logging in real applications. Here are some questions that might help to explain your answer. Frameworks What frameworks do you use? log4net System.Diagnostics.Trace System.Diagnostics.TraceSource Logging application block Other? If you use tracing, do you make use of ...

Message Queue Windows Service

I wish to write a windows service in .Net 2.0 that listens to and processes a Message Queue (MSMQ). Rather than reinvent the wheel, can someone post an example of the best way to do it? It only has to process things one at a time, never in parallel (eg. Threads). Essentially I want it to poll the queue, if there's anything there, proc...

Asynchronous Webrequest best practices

What is the best practice for getting a webrequest asynchronously? I want to download a page from the internet (doesn't matter what) and avoid blocking a thread as much as possible. Previously I believed that it was enough to just use the 'BeginGetResponse' and 'EndGetResponse' pair. But on closer inspection I also see that there is t...