Show my dataset in a datagrid...
-
all by code. I really hope some of you can help me, since I'm really stuck. What I have done is that I've made a datalayer which returns a populated dataset and want to show it in my grid on my webform. Using : Debug.Write(dsActivity.XmlData.ToString()); I know that the dataset that is returned is populated. What I do on the .cs class to the form is: //Gets the data from the my datalayer. dsActivity = obActivity.getActivities(); //To ensure that there is data in the dataset Debug.Write(dsActivity.XmlData.ToString()); dgActivities.DataSource= dsActivity.DefaultView; dgActivities.DataBind(); /* Below I've pasted the getActivities routine */ public DataSet getActivities() { dscActivity.SelectCommand = new System.Data.ADO.ADOCommand(null, null, System.Data.CommandType.StoredProcedure , true, null,System.Data.UpdateRowSource.None); dscActivity.SelectCommand.CommandText= "Rastafa_Activity_getActivities"; // The name of the Stored Procedure. //maps tables and columns in a collection dscActivity.TableMappings.All = new System.Data.Internal.DataTableMapping[1] { new System.Data.Internal.DataTableMapping ("Table", "Rastafa_Activity_getActivities")}; return bDBClass.DataSetExecuteStoredProcedure(dscActivity); } /* Stian Fagereng */ X|