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. General Programming
  3. C#
  4. Data Access & Tab Control

Data Access & Tab Control

Scheduled Pinned Locked Moved C#
databaseperformanceannouncement
1 Posts 1 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.
  • R Offline
    R Offline
    rich_wenger
    wrote on last edited by
    #1

    Hi, and thanks for your interest. I have some databound textboxes that are grouped on a number of pages in a tabcontrol. I use a button to call up a dialog box to pull data from a lookup table to speed populating some of the textboxes on the tab control. Updates seem to work fine untill I add some additional code in the Update event to check for null conditions. Then it gets strange, after I fill the textboxes from the lookup dialog I have to click in one (doesn't seem to matter which) of the filled textboxes for the updated information to be posted to the database. I have no code associated with tabcontrol or textbox mouse events on the form. Code To Open Dialog (Form1)======================================== private void btnLmoLookup_Click(object sender, System.EventArgs e) { Form2 LmoLookup = new Form2(); LmoLookup.StartPosition = FormStartPosition.CenterParent; if( LmoLookup.ShowDialog() == DialogResult.OK ) { txtBoxDocName.Text = LmoLookup.docFullName; } LmoLookup.Dispose(); } Code To Declare Public Variable (Form2)================================== public string docFullName { get{return this.dsExtPhysLookup1.Tables["tblExternalPhysicians"].Rows[this.listBox1.SelectedIndex]["docFullName"].ToString();} } Code To Perform Update (Form1)=========================================== if(this.txtBoxDocName.Text.Trim().Length == 0) { this.dsPatientIndex1.Tables["tblPatientIndex"].Rows[this.BindingContext[dsPatientIndex1, "tblPatientIndex"].Position]["patientRefDName"] = DBNull.Value; } else { this.dsPatientIndex1.Tables["tblPatientIndex"].Rows[this.BindingContext[dsPatientIndex1, "tblPatientIndex"].Position]["patientRefDName"] = txtBoxDocName.Text.Trim(); } this.BindingContext[this.dsPatientIndex1, "tblPatientIndex"].EndCurrentEdit(); this.sqlDataAdapter2.Update(this.dsPatientIndex1); -- modified at 8:53 Friday 7th October, 2005

    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