index | search | no replies | posting guidelines | help | login | register |
Index » Products » ASP DataGrid |
| |||||||
May 22 2004, 10:23 AM |
| ||||||
ghost from: Washington, DC | Make sure you set the procedure Display to the datagrid as follows: objGrid.Display The code below is the one I used to test and it works fine: <% @LANGUAGE= "VBSCRIPT" CODEPAGE= "1252" %> <% 'declare variables Dim objGrid Dim strConn Dim strSQL 'Build a connection string to the Northwind database strConn = "Provider=MSDASQL;Driver={SQL Server};Server=(local);Database=NOrthwind;User ID=sa;Password=sa;" 'Build an SQL command statement strSQL = "select * from customers" ' Create an instance of DataGrid Set objGrid = Server .CreateObject("AspWebSolution.DataGrid" ) With objGrid 'Set your command statement .Command = strSQL 'Set your desired font colors & style .GridStyle = "background-color:gray;" .HeaderStyle = "background-color:#666699; color:white;" .HeaderTextStyle = "color:white; font-size:8pt;" .ItemStyle = "background-color:#cccccc; font-size:8pt;" .AltItemStyle = "background-color:white; font-size:8pt;" .FooterStyle= "font-size:8pt;" 'Create a databse connection .CreateConnection (strConn) End With %> <html> <head><title>My Title</title></head> <body> <h1>Hello World</h1> <% 'Display the data grid objGrid.Display 'distroy objects Set objGrid = Nothing %> </body> </html> Let me know if this helps... ------------------------- Ghost | ||||||
Pages: (1) [1] |