Click here to Skip to main content
15,905,616 members
Home / Discussions / C#
   

C#

 
GeneralRe: Program Structure Pin
Kash6-Sep-05 6:45
Kash6-Sep-05 6:45 
AnswerRe: Program Structure Pin
leppie6-Sep-05 7:06
leppie6-Sep-05 7:06 
Question.Net CF 2.0 & Pocket Internet Explorer Pin
tomdz6-Sep-05 6:20
tomdz6-Sep-05 6:20 
Questionfaster access memory Pin
Sasuko6-Sep-05 6:18
Sasuko6-Sep-05 6:18 
AnswerRe: faster access memory Pin
Judah Gabriel Himango6-Sep-05 6:26
sponsorJudah Gabriel Himango6-Sep-05 6:26 
AnswerRe: faster access memory Pin
Dan Neely6-Sep-05 7:06
Dan Neely6-Sep-05 7:06 
AnswerRe: faster access memory Pin
Andrew Kirillov6-Sep-05 8:25
Andrew Kirillov6-Sep-05 8:25 
QuestionDirectPlay Problem with C# Pin
Zeeshan Gulzar6-Sep-05 5:20
Zeeshan Gulzar6-Sep-05 5:20 
QuestionSaved file images Pin
Jerry Hammond6-Sep-05 4:49
Jerry Hammond6-Sep-05 4:49 
AnswerRe: Saved file images Pin
Nick Parker6-Sep-05 8:44
protectorNick Parker6-Sep-05 8:44 
GeneralRe: Saved file images Pin
Jerry Hammond6-Sep-05 10:40
Jerry Hammond6-Sep-05 10:40 
QuestionWindows Services Pin
Member 19735946-Sep-05 4:39
Member 19735946-Sep-05 4:39 
QuestionClient/Server Communication Pin
batmanAgen6-Sep-05 4:35
batmanAgen6-Sep-05 4:35 
AnswerRe: Client/Server Communication Pin
John Fisher6-Sep-05 4:45
John Fisher6-Sep-05 4:45 
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 

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.