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. Database & SysAdmin
  3. Database
  4. Dataset VS Datagrid

Dataset VS Datagrid

Scheduled Pinned Locked Moved Database
databasevisual-studioxmlhelpquestion
5 Posts 3 Posters 0 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.
  • T Offline
    T Offline
    TheJudeDude
    wrote on last edited by
    #1

    I have the following code: sqlDataAdapter2.SelectCommand.Parameters["@Id"].Value = intId; sqlDataAdapter2.SelectCommand.Parameters["@Bdate"].Value = dtpFrom.Value; sqlDataAdapter2.SelectCommand.Parameters["@Edate"].Value = dtpTo.Value; int intRows = sqlDataAdapter2.Fill(dataTime1,"Timesheet"); dgTime.Update(); The fill method is returning the right amount of rows (double check wwith a query) dgTime's datasource property is dataTime1.schema. But the datagrid never get's populated? Any ideas? Anymore info you may need to help me? Thanx in advance!

    Jude

    C 1 Reply Last reply
    0
    • T TheJudeDude

      I have the following code: sqlDataAdapter2.SelectCommand.Parameters["@Id"].Value = intId; sqlDataAdapter2.SelectCommand.Parameters["@Bdate"].Value = dtpFrom.Value; sqlDataAdapter2.SelectCommand.Parameters["@Edate"].Value = dtpTo.Value; int intRows = sqlDataAdapter2.Fill(dataTime1,"Timesheet"); dgTime.Update(); The fill method is returning the right amount of rows (double check wwith a query) dgTime's datasource property is dataTime1.schema. But the datagrid never get's populated? Any ideas? Anymore info you may need to help me? Thanx in advance!

      Jude

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Did you bind the datagrid. Update is, if I remember, to put changes made in the data grid back into the database.


      Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      T 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Did you bind the datagrid. Update is, if I remember, to put changes made in the data grid back into the database.


        Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

        T Offline
        T Offline
        TheJudeDude
        wrote on last edited by
        #3

        Desktop App, not web...No databind() for this object

        Jude

        K 1 Reply Last reply
        0
        • T TheJudeDude

          Desktop App, not web...No databind() for this object

          Jude

          K Offline
          K Offline
          Keith Malwitz
          wrote on last edited by
          #4

          You still need to bind the datagridview to the data you wish to display. Check out these articles: http://msdn2.microsoft.com/en-US/library/071hftc7.aspx[^] http://msdn2.microsoft.com/en-US/library/wwh8ka92.aspx[^] Hope this helps.

          T 1 Reply Last reply
          0
          • K Keith Malwitz

            You still need to bind the datagridview to the data you wish to display. Check out these articles: http://msdn2.microsoft.com/en-US/library/071hftc7.aspx[^] http://msdn2.microsoft.com/en-US/library/wwh8ka92.aspx[^] Hope this helps.

            T Offline
            T Offline
            TheJudeDude
            wrote on last edited by
            #5

            OK - check this out. I just ran a simple test to comfirm something. Here is what I did step by step. 1) Create new project(Windows Application). 2) Dragged a sqlDataAdapter onto the form. 3) Went through the wizard (create new connection, use sql statements, query builder, chose table, chose all columns. 4) Generate Dataset. 5) Dragged DataGrid onto form. 6) Set the Datasource property of the datagrid to the dataset.table 7) Added sqlDataAdapter.Fill to the load method of the form. Worked fine. I am doing the same with the project in question. The only difference is in the SELECT Statement. I am joining two tables into the data set and it is a stored procedure.

            Jude

            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