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. Simple question about data DataSet, DataView and DataGrid

Simple question about data DataSet, DataView and DataGrid

Scheduled Pinned Locked Moved C#
questiondatabase
2 Posts 2 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.
  • G Offline
    G Offline
    goldoche
    wrote on last edited by
    #1

    Hi, I am working on a simple database project and I am confused about data bindings between DataSet, DataView and DataGrid objects. I connect to a database, I build my DataSet, I bind it to a DataView, which I bind to a DataGrid. My DataGrid displays my stuff correctly, but I was wondering how I can make a change to my DataView so that both my DataGrid and my DataSet will take these changes as well... And if I make a change to my DataGrid, will the change be present in both my DataView and My DataSet? And if I make a change to my DataSet, will it be reflected in the DataView and the DataGrid? How does all thes things work? Thank you very much!

    K 1 Reply Last reply
    0
    • G goldoche

      Hi, I am working on a simple database project and I am confused about data bindings between DataSet, DataView and DataGrid objects. I connect to a database, I build my DataSet, I bind it to a DataView, which I bind to a DataGrid. My DataGrid displays my stuff correctly, but I was wondering how I can make a change to my DataView so that both my DataGrid and my DataSet will take these changes as well... And if I make a change to my DataGrid, will the change be present in both my DataView and My DataSet? And if I make a change to my DataSet, will it be reflected in the DataView and the DataGrid? How does all thes things work? Thank you very much!

      K Offline
      K Offline
      Keshav V Kamat 0
      wrote on last edited by
      #2

      You can also bind a dataset to a datagrid directly

      DataSet dataSet=new DataSet();
      DataGrid1.DataSource=dataSet;

      Similarly, at anytime, you can bind the contents of a datagrid to a dataset.

      DataSet dataSet=new DataSet();
      dataSet = (DataSet)DataGrid1.DataSource;

      Keshav Kamat :) India

      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