Be aware (beware) that VS.Net 2005 is somewhat designed for SQL Server 2005. It sounds like you can still use it with SQL Server 2000, but I don't know what pitfalls await there (MS tying products together?!? Shocking!). ASP.Net 2.0 is quite different from ASP.Net 1.1 as well. Fortunately you can run VS.NET 2003 and VS.NET 2005 side by side.

If you can solve whatever other problems you are having with the DataGrid, here's how to do autosizing of columns with the DataGrid: [link|http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q877q|http://www.syncfusio...Q_c44c.aspx#q877q] That FAQ is a good reference overall for WinForms programming.

In case we missed something else, here's the code based on yours that worked for me with a empty form on which I dropped a DataGrid named DisplayGrid and a OleDbConnection named objCon. I also used an Access DB instead of SQL Server. And I've excised the designer generated code (which BTW, is where all that point and click config of the DataGrid from my original solution would appear as code).

\nPublic Class Form1\n    Inherits System.Windows.Forms.Form\n\n#Region " Windows Form Designer generated code "\n...\n#End Region\n    Dim MyDataAdapter As System.Data.OleDb.OleDbDataAdapter\n    Dim MyDataset As System.Data.DataSet\n\n    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load\n        Dim strSQL As String\n\n        strSQL = "SELECT DISTINCT ProductCode, ProductName FROM Products"\n        strSQL = strSQL & " WHERE ProductName IS NOT NULL ORDER BY ProductName"\n        MyDataAdapter = New System.Data.OleDb.OleDbDataAdapter(strSQL, objCon)\n        MyDataset = New DataSet("ProductsDataset")\n        MyDataAdapter.Fill(MyDataset, "Products")\n        DisplayGrid.DataSource = MyDataset.Tables("Products")\n\n\n        Dim myGridStyle As DataGridTableStyle = New DataGridTableStyle\n        myGridStyle.MappingName = "Products"\n        ' \n        '     The ProductCode is a 3 byte varchar field \n        ' \n        Dim myFirstColumn As DataGridColumnStyle = New DataGridTextBoxColumn\n        myFirstColumn.MappingName = "ProductCode"\n        myFirstColumn.HeaderText = "Code"\n        myFirstColumn.Width = 40\n        myFirstColumn.Alignment = HorizontalAlignment.Center\n        ' \n        '     The ProductDesc is a 50 byte varchar field \n        ' \n        Dim mySecondColumn As DataGridColumnStyle = New DataGridTextBoxColumn\n        mySecondColumn.MappingName = "ProductName"\n        mySecondColumn.HeaderText = "Name"\n        mySecondColumn.Width = 400\n        mySecondColumn.Alignment = HorizontalAlignment.Left\n\n\n        myGridStyle.GridColumnStyles.Add(myFirstColumn)\n        myGridStyle.GridColumnStyles.Add(mySecondColumn)\n\n\n        DisplayGrid.TableStyles.Add(myGridStyle)\n    End Sub\nEnd Class\n


Good luck!