DataGrid In ASP.NET Page?
-
I am new to using ASP.NET although I have written several applications in VB.NET. I am trying to dispaly data from a database in a datagrid. I fill a dataset with data using a stored procedure from a SQL server database. I then set the datasource property of the datagrid equal to the dataset. The problem is the datagrid is never displayed on my page. the weird thing is the rowcount of the datagrid is correct. Any ideas?
-
I am new to using ASP.NET although I have written several applications in VB.NET. I am trying to dispaly data from a database in a datagrid. I fill a dataset with data using a stored procedure from a SQL server database. I then set the datasource property of the datagrid equal to the dataset. The problem is the datagrid is never displayed on my page. the weird thing is the rowcount of the datagrid is correct. Any ideas?
-
Hmmmm.....some thoughts: 1. How did you add the datagrid to the webform? 2. Did you databind the grid? 3. When did you databind the grid? Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
-
I am new to using ASP.NET although I have written several applications in VB.NET. I am trying to dispaly data from a database in a datagrid. I fill a dataset with data using a stored procedure from a SQL server database. I then set the datasource property of the datagrid equal to the dataset. The problem is the datagrid is never displayed on my page. the weird thing is the rowcount of the datagrid is correct. Any ideas?
Hi, Have you ensured that you call DataBind() on your data grid after you set the data source?
DataGrid dgMyDataGrid = new DataGrid(); DataSet dsMyData = new DataSet(); ... Setup your dataset ... dgMyDataGrid.DataSource = dsMyData.Tables[0]; **dgMyDataGrid.DataBind();**
Give that a shot! Nick. Nick.