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. System.Data.NoNullAllowedException

System.Data.NoNullAllowedException

Scheduled Pinned Locked Moved C#
databasewpfwcfhelptutorial
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

    I've used VS2003 Wizard to create sqlDataAdapter, stored procedures, and dataset on my application. I can search and update fine but Insert has error unless I perform a search or update prior to my insert. Any ideas on how to work around this without rewriting the database?:sigh: Code Snippet ================================================================ static void Main() { Application.Run(new Form1()); } private void menuItem2_Click(object sender, System.EventArgs e) { //Initialize Staff Physician Screen SetupStaffPhysician(); menuItem2.Enabled = false; } private void menuItem3_Click(object sender, System.EventArgs e) { //Exit Application Application.Exit(); } private void SetupStaffPhysician() { panel1.Visible = true; this.comboBox1.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", this.dsStaffPhysicians1, "tblStaffPhysicians.docLicenseState")); } private void ClearStaffPhysicians() { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; textBox5.Text = ""; comboBox1.SelectedIndex = 0; } private void btnSearch_Click(object sender, System.EventArgs e) { sqlDataAdapter1.SelectCommand.Parameters["@Param2"].Value = textBox3.Text; dsStaffPhysicians1.Clear(); sqlDataAdapter1.Fill(dsStaffPhysicians1); } private void btnReset_Click(object sender, System.EventArgs e) { this.dsStaffPhysicians1.Clear(); ClearStaffPhysicians(); } private void btnUpdate_Click(object sender, System.EventArgs e) { this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].EndCurrentEdit(); sqlDataAdapter1.Update(dsStaffPhysicians1); sqlDataAdapter1.Fill(dsStaffPhysicians1); } private void btnInsert_Click(object sender, System.EventArgs e) { this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].AddNew(); ClearStaffPhysicians(); } private void btnCommit_Click(object sender, System.EventArgs e) { this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].EndCurrentEdit(); sqlDataAdapter1.Update(dsStaffPhysicians1); } } } "She folds her legs...in doing so I glimpse Xanadu."--Gilby

    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