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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. datagridview in tabcontrol!

datagridview in tabcontrol!

Scheduled Pinned Locked Moved Database
tutorialdatabasequestionannouncement
2 Posts 2 Posters 1 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.
  • J Offline
    J Offline
    jeshra279
    wrote on last edited by
    #1

    hi everyone, I have a tab control with 3 tabs, A,B,C. I have one one database "student" in which i have 4 columns. There are two datagridviewB and datagridviewC in the two tabs B and C. I am updating the entries of a datagridviewB by entering details in a form present in Tab A. Now when I am working in tab C to update the datagridviewC, say for example filtering "student" database and displaying filtered results in datagridviewC; while updating datagridviewC, I noticed that datagridviewB in tab B also getting updated. My code for filter "student" database in tab C is like this: cmd = New SqlCommand("SELECT * FROM student WHERE [Name] <= '" + name + "'", con) myDA = New SqlDataAdapter(cmd) myDataSet = New DataSet() myDA.Fill(myDataSet, "student") datagridviewC.DataSource = myDataSet.Tables("student").DefaultView Can someone tell me, how to update the datagridviewC in tab C without altering the entries present in datagridviewB in tab B? FYI : my datagridviewB contains all the student data and in tab C i am filtering the database based on "Name" and displaying in datagridviewC.

    M 1 Reply Last reply
    0
    • J jeshra279

      hi everyone, I have a tab control with 3 tabs, A,B,C. I have one one database "student" in which i have 4 columns. There are two datagridviewB and datagridviewC in the two tabs B and C. I am updating the entries of a datagridviewB by entering details in a form present in Tab A. Now when I am working in tab C to update the datagridviewC, say for example filtering "student" database and displaying filtered results in datagridviewC; while updating datagridviewC, I noticed that datagridviewB in tab B also getting updated. My code for filter "student" database in tab C is like this: cmd = New SqlCommand("SELECT * FROM student WHERE [Name] <= '" + name + "'", con) myDA = New SqlDataAdapter(cmd) myDataSet = New DataSet() myDA.Fill(myDataSet, "student") datagridviewC.DataSource = myDataSet.Tables("student").DefaultView Can someone tell me, how to update the datagridviewC in tab C without altering the entries present in datagridviewB in tab B? FYI : my datagridviewB contains all the student data and in tab C i am filtering the database based on "Name" and displaying in datagridviewC.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      If your datasource for the datagridviews is the same then naturally the data is the same. You can separate the datasources into bindingsources or copy the dataview to a new table for each datagridview. BTW this should be in the Windows Forms forum.

      Never underestimate the power of human stupidity RAH

      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