Click here to Skip to main content
15,178,979 members
Home / Discussions / C#
   

C#

 
Questionweb.config Help Pin
Brendan Vogt6-Sep-05 4:25
MemberBrendan Vogt6-Sep-05 4:25 
AnswerRe: web.config Help Pin
Mohamad Al Husseiny6-Sep-05 5:27
MemberMohamad Al Husseiny6-Sep-05 5:27 
QuestionBest practice with threads? Pin
6-Sep-05 4:13
suss6-Sep-05 4:13 
AnswerRe: Best practice with threads? Pin
John Fisher6-Sep-05 5:36
MemberJohn Fisher6-Sep-05 5:36 
AnswerRe: Best practice with threads? Pin
Andy Brummer6-Sep-05 5:46
sitebuilderAndy Brummer6-Sep-05 5:46 
Questioncode management software Pin
Mridang Agarwalla6-Sep-05 3:50
MemberMridang Agarwalla6-Sep-05 3:50 
QuestionFaulting application Pin
BenniEvald6-Sep-05 3:24
MemberBenniEvald6-Sep-05 3:24 
QuestionFill After Insert Fails Pin
rich_wenger6-Sep-05 3:00
Memberrich_wenger6-Sep-05 3:00 
I've created a sqldataadapter, stored procedures, and a data set using the VS2003 IDE Wizard based on a select command with a single paramter; search and updates work fine. I've got non-null columns in my database so I had to create a new Datarow in the data set and update that to perform an insert. The problem is the follow-up fill (sqlDataAdapter1.Update(dsStaffPhysicians1) to repopulate the dataset errors. Any help would be greatly appreciated.


Code Snippet Follows=================================================


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)
{
try
{
ClearStaffPhysicians();
}
catch(Exception exp)
{
MessageBox.Show("Error 001 " + exp.Message);
}
}

private void btnCommit_Click(object sender, System.EventArgs e)
{
DataRow newStaffPhysician = dsStaffPhysicians1.Tables["tblStaffPhysicians"].NewRow();
newStaffPhysician["docLName"] = textBox3.Text;
newStaffPhysician["docFName"] = textBox1.Text;
newStaffPhysician["docMName"] = textBox2.Text;
newStaffPhysician["docLicenseState"] = comboBox1.SelectedIndex;
newStaffPhysician["docLicenseNumber"] = textBox4.Text;
newStaffPhysician["docUpin"] = textBox5.Text;
dsStaffPhysicians1.Tables["tblStaffPhysicians"].Rows.Add(newStaffPhysician);
sqlDataAdapter1.Update(dsStaffPhysicians1);
//Fill method will error!!
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}


}
}
AnswerRe: Fill After Insert Fails Pin
John Fisher6-Sep-05 5:53
MemberJohn Fisher6-Sep-05 5:53 
QuestionUnload DOM Pin
ksanju10006-Sep-05 2:28
Memberksanju10006-Sep-05 2:28 
AnswerRe: Unload DOM Pin
John Fisher6-Sep-05 6:21
MemberJohn Fisher6-Sep-05 6:21 
GeneralRe: Unload DOM Pin
ksanju10006-Sep-05 21:35
Memberksanju10006-Sep-05 21:35 
GeneralRe: Unload DOM Pin
John Fisher7-Sep-05 5:09
MemberJohn Fisher7-Sep-05 5:09 
QuestionWeb Services in VS 2003 Pin
seee sharp6-Sep-05 2:22
Memberseee sharp6-Sep-05 2:22 
QuestionRichetextbox problem again Pin
snouto6-Sep-05 2:13
Membersnouto6-Sep-05 2:13 
AnswerRe: Richetextbox problem again Pin
S. Senthil Kumar6-Sep-05 2:51
MemberS. Senthil Kumar6-Sep-05 2:51 
GeneralRe: Richetextbox problem again Pin
snouto6-Sep-05 3:08
Membersnouto6-Sep-05 3:08 
GeneralRe: Richetextbox problem again Pin
S. Senthil Kumar6-Sep-05 3:46
MemberS. Senthil Kumar6-Sep-05 3:46 
QuestionBase Class problem with forms Pin
Russell Jones6-Sep-05 1:34
MemberRussell Jones6-Sep-05 1:34 
AnswerRe: Base Class problem with forms Pin
S. Senthil Kumar6-Sep-05 3:00
MemberS. Senthil Kumar6-Sep-05 3:00 
GeneralRe: Base Class problem with forms Pin
Russell Jones6-Sep-05 3:33
MemberRussell Jones6-Sep-05 3:33 
QuestionThreading and Forms Pin
Dani Duran Kenobi6-Sep-05 1:33
MemberDani Duran Kenobi6-Sep-05 1:33 
AnswerRe: Threading and Forms Pin
S. Senthil Kumar6-Sep-05 3:04
MemberS. Senthil Kumar6-Sep-05 3:04 
QuestionControl Problems? Pin
Simon Wren6-Sep-05 0:36
professionalSimon Wren6-Sep-05 0:36 
AnswerRe: Control Problems? Pin
S. Senthil Kumar6-Sep-05 3:12
MemberS. Senthil Kumar6-Sep-05 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.