Click here to Skip to main content
15,881,812 members
Home / Discussions / C#
   

C#

 
Questionweb.config Help Pin
Brendan Vogt6-Sep-05 3:25
Brendan Vogt6-Sep-05 3:25 
AnswerRe: web.config Help Pin
Mohamad Al Husseiny6-Sep-05 4:27
Mohamad Al Husseiny6-Sep-05 4:27 
QuestionBest practice with threads? Pin
6-Sep-05 3:13
suss6-Sep-05 3:13 
AnswerRe: Best practice with threads? Pin
John Fisher6-Sep-05 4:36
John Fisher6-Sep-05 4:36 
AnswerRe: Best practice with threads? Pin
Andy Brummer6-Sep-05 4:46
sitebuilderAndy Brummer6-Sep-05 4:46 
Questioncode management software Pin
Mridang Agarwalla6-Sep-05 2:50
Mridang Agarwalla6-Sep-05 2:50 
QuestionFaulting application Pin
BenniEvald6-Sep-05 2:24
BenniEvald6-Sep-05 2:24 
QuestionFill After Insert Fails Pin
rich_wenger6-Sep-05 2:00
rich_wenger6-Sep-05 2: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 4:53
John Fisher6-Sep-05 4:53 
QuestionUnload DOM Pin
ksanju10006-Sep-05 1:28
ksanju10006-Sep-05 1:28 
AnswerRe: Unload DOM Pin
John Fisher6-Sep-05 5:21
John Fisher6-Sep-05 5:21 
GeneralRe: Unload DOM Pin
ksanju10006-Sep-05 20:35
ksanju10006-Sep-05 20:35 
GeneralRe: Unload DOM Pin
John Fisher7-Sep-05 4:09
John Fisher7-Sep-05 4:09 
QuestionWeb Services in VS 2003 Pin
seee sharp6-Sep-05 1:22
seee sharp6-Sep-05 1:22 
QuestionRichetextbox problem again Pin
snouto6-Sep-05 1:13
snouto6-Sep-05 1:13 
AnswerRe: Richetextbox problem again Pin
S. Senthil Kumar6-Sep-05 1:51
S. Senthil Kumar6-Sep-05 1:51 
GeneralRe: Richetextbox problem again Pin
snouto6-Sep-05 2:08
snouto6-Sep-05 2:08 
GeneralRe: Richetextbox problem again Pin
S. Senthil Kumar6-Sep-05 2:46
S. Senthil Kumar6-Sep-05 2:46 
QuestionBase Class problem with forms Pin
Russell Jones6-Sep-05 0:34
Russell Jones6-Sep-05 0:34 
AnswerRe: Base Class problem with forms Pin
S. Senthil Kumar6-Sep-05 2:00
S. Senthil Kumar6-Sep-05 2:00 
GeneralRe: Base Class problem with forms Pin
Russell Jones6-Sep-05 2:33
Russell Jones6-Sep-05 2:33 
QuestionThreading and Forms Pin
Dani Duran Kenobi6-Sep-05 0:33
Dani Duran Kenobi6-Sep-05 0:33 
AnswerRe: Threading and Forms Pin
S. Senthil Kumar6-Sep-05 2:04
S. Senthil Kumar6-Sep-05 2:04 
QuestionControl Problems? Pin
Simon Wren5-Sep-05 23:36
professionalSimon Wren5-Sep-05 23:36 
AnswerRe: Control Problems? Pin
S. Senthil Kumar6-Sep-05 2:12
S. Senthil Kumar6-Sep-05 2: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.