.net

Regular expression to find all table names in a query

Hi all, I am not that hot at regular expressions and it has made my little mind melt so what. I am trying to find all the tables names in a query. So say I have the query: SELECT one, two, three FROM table1, table2 WHERE X=Y I would like to pull out "table1, table2" or "table1" and "table2" But what if there is no where statement....

How do I keep a Windows Mobile Professional Device in the Unattended Power State

I have a .net 3.5 application running on windows mobile professional that uses sql server ce 3.5 and merge replication with sql server 2005 sp2, it not yet a 1.0 product. Every couple of minutes or so it starts a merge replication using a timer control. I suppose down the line I'll have to have some kind of push senario, either using l...

ASP.Net MVC framework and databinding

Hi, I am having some trouble grasping some concepts behind the MVC framework. I am doing a very simple application which categorizes products. The Creation screen will simply use a dropdown list showing the list of categories, the name of the product and submit. On a normal .Net app, I would databind a server dropdownlist in the Page_...

Is there a way to validate XML using T-SQL?

I'm in the process of converting a varchar(8000) field to an xml field in MSSQL 2005. Many of the XML docs have small issues (example: degree symbol not encoded). Is there a better way to validate the XML than a Try/Catch process? Maybe I could write a .NET Stored Procedure. What is the proper method to validate (or invalidate) an XML d...

Unpacking MSI in .Net

I have an installer that deploys web services to IIS. After this has finshed a custom action fires that updates the database with the scripts required by the webservices. The scripts are currently deploying to IIS aswell because they are part of the .net project. How can I configure the installation process so the scripts arn't part o...

ClickOnce .appref-ms more than a link to .application file?

I have a ClickOnce environment like this: \Fileserver\ClickOnceApps\App1.application C:\Documents and Settings\user\Start Menu\Programs\publisher\app1.appref-ms My understanding is the .apppref-ms file is a glorified link to the app.application file. Does it do anything else? ...

Is it OK to overload ShowDialog() so that a child form returns information as an out parameter?

In an earlier question about how to return a string from a dialog window, yapiskan suggested overloading the child form's ShowDialog() method to include an out parameter. My question is whether or not this is a good approach in C#. Here is some example code, based on yapiskan's suggestion. In the child form (in this example, it's a fo...

Is there a way in .NET to make your overload of a method appear first in the Intellisense dropdown?

In a form, I added an overload of ShowDialog(). In Visual Studio, this overload shows up in Intellisense as the third version. How can I make my overloaded function appear as #1 (i.e. the default)? ...

Read-only DataGridView and IEditableObject

Good evening I've got a little problem with my DataGridView in a .NET Windows Forms project. The grid is read-only and bound to a sortable BindingList<T> which contains custom business objects. My business object class does implement IEditableObject. Now the BeginEdit and EndEdit methods are called all the time while navigating in the ...

SELECT INTO with an additional column

I am attempting to insert a copy of a row from one table into another table with the same schema, with the addition of one column (a timestamp) to provide a "history" of the first table in MS Sql Server 2005. So, my query, without the additional column would be: "SELECT INTO [WebsiteHistory] FROM [Website]" I want to populate the tim...

What does the filterpriority tag in an XML comment do?

I have seen this in a lot of XML comments for classes in the .NET Framework BCL but have never been able to find documentation that explains what it does. As an example, looking at System.Object reveals the following comments: namespace System { /// <summary>Supports all classes in the .NET Framework class hierarchy /// and...

Class to automatically pull database fields into .NET Controls

I'm building a class that automatically loads a DB record, looks at each DB column name, and fills the associated textbox/label/literal/etc, if it has the same name. I got this idea from Rails, in case that helps clarify what I'm trying to do. public string presentData(Page thisForm) { // .. for each column name // ... thisForm.FindCon...

Best .Net library to edit WMA tags?

I have found a few libraries to edit MP3 tags (UltraID3Lib is great) but none that will edit tags for WMA files. Can anyone recommend a .net library for editing WMA tags / metadata ? Thanks MATT ...

WaitCursor on sort in DataGridView

I am using the standard .Net 2.0 DataGridView with sort mode of automatic on the column. It is very very slow (which should probably be another question on how to speed it up) but I can't seem to find an event or combination of events that will maintain a WaitCursor while this sort operation is being performed. Ideas? ...

What are the server requirements for Silverlight 2?

Can a Silverlight 2 enabled web page be managed from an Apache server? (I'm not actually interested in doing this but trying to understand Silverlight 2 a bit more.) Assuming that I have IIS6 and Server 2003 what are the .NET version requirements to host a web site with Silverlight 2? Are .NET 3.0 and 3.5 required on the server? My thin...

FileSystemWatcher and network disconnect?

How can I make it work in a network? It works then it stops working without reason (maybe because the network isn't perfect). ...

Display collections of objects in DataGridViews

Using an ORM approach in applications can often lead to the scenario where you have a collection of objects you've retrieved and would like to display them in a tabular view using a DataGridView. In my (limited) experience, binding collections of objects using a custom BindingList to a DataGridView results in poor performance and unsati...

What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows?

What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows? It would also be great to see some actual timings of Int64 vs Int32 on each of the two operating system variants. XP or Vista would also be interesting. See also this question about memcpy performance. ...

Use a separate scroll bar for a textbox

I am developing a touch screen application that has to display a possibly large amount of text. The problem I am having is that the default scroll bar attached to text boxes is just too small to be practically used in a touch screen application. I have tried adding a separate scroll bar control and using it to control the scrolling of th...

How do I get a human-readable file size using .NET?

I assume this was already answered somewhere on SO, but I must be looking for the wrong keywords. I'll gladly remove this question if its a dup. If not, let's answer the question here. Example: Take input 7,326,629 and display 6.98 MB ...