Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Show my dataset in a datagrid...

Show my dataset in a datagrid...

Scheduled Pinned Locked Moved C#
helpcssdatabasedebugging
1 Posts 1 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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|

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups