Skip to main content

Posts

Showing posts from March, 2005

Visual Studio Team System Site

Visual Studio Team System Site
http://www.microsoft.com/vstudio/teamsystem
Version Control Blogs
http://blogs.msdn.com/korbyp/
http://blogs.msdn.com/buckh/
http://blogs.msdn.com/bharry/
Work Item Tracking Blogs
http://blogs.msdn.com/brianwh/
http://blogs.msdn.com/kkellyatms/

GMail Drive shell extension

Convert your gmail accounts into web space with this utility:


GMail Drive shell extension


Makes it as easy as drag and drop files in explorer and all files show under web UI as attachments in emails.. Also cannot drop a file of more than 10MB for now as gmail doesn't let you have more than that amount of file as attachment...

How to Read Hierarchical Data into a DataSet

http://www.kbalertz.com/Feedback_309487.aspx (via .NET 247)

This example uses the Customers and Orders tables that are included with the Microsoft SQL Server sample Northwind database:
1. Create a new Visual C# Console Application project. Class1.cs is created by default.
2. If the Code window is not open, right-click Class1.cs in Solution Explorer, and then click View Code.
3. Delete all of the code from the Code window.
4. Paste the following code into the Code window:

using System;
using System.Data;
using System.Data.OleDb;


namespace CSharpSample
{
///
/// Summary description for Class1
///
class Class1
{
///
/// The main entry point for the application
///
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
OleDbConnection nwindConn = new OleDbConnection("Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=l…

5.35 How do I set the width of a column in my DataGrid?

Windows Forms FAQ - Windows Forms Datagrid: "5.35 How do I set the width of a column in my DataGrid?


To set a column width, your datagrid must be using a non-null DataGridTableStyle. Once this is in place, you can set the column width by first getting the tablestyle and then using that object to obtain a column style with which you can set the width. Here are some code snippets showing how you might do this.
//.... make sure your DataGrid is using a tablestyle
dataGrid1.DataSource = _dataSet.Tables['customers'];
DataGridTableStyle dgts = new DataGridTableStyle();
dgts.MappingName = 'customers';
dataGrid1.TableStyles.Add(dgts);

//......

//method to set a column with by colnumber
public void SetColWidth(DataGridTableStyle tableStyle, int colNum, int width)
{
try
{
tableStyle.GridColumnStyles[colNum].Width = width;
tableStyle.DataGrid.Refresh();
}
catch{} //empty catch .. do nothing
}

//....

// here is how you might call this m…

Secure ASP.NET sites from XSS

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh21.asp

Use the following module:
http://support.microsoft.com/kb/887289

If you think you can just hard code a few chars to prevent it, try
http://www.shocking.com/~rsnake/xss.html