Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
Questionmanaged resources Pin
CWinThread4-Sep-05 6:40
CWinThread4-Sep-05 6:40 
AnswerRe: managed resources Pin
Guffa4-Sep-05 6:45
Guffa4-Sep-05 6:45 
GeneralRe: managed resources Pin
CWinThread4-Sep-05 10:52
CWinThread4-Sep-05 10:52 
QuestionMulti users and Multi connectios in client/server application Pin
rmedo4-Sep-05 4:09
rmedo4-Sep-05 4:09 
AnswerRe: Multi users and Multi connectios in client/server application Pin
Christian Graus4-Sep-05 10:54
protectorChristian Graus4-Sep-05 10:54 
GeneralRe: Multi users and Multi connectios in client/server application Pin
rmedo4-Sep-05 20:22
rmedo4-Sep-05 20:22 
GeneralRe: Multi users and Multi connectios in client/server application Pin
Christian Graus5-Sep-05 10:49
protectorChristian Graus5-Sep-05 10:49 
QuestionSystem.Data.NoNullAllowedException Pin
rich_wenger4-Sep-05 3:48
rich_wenger4-Sep-05 3:48 
Hi,
I'm working in VS2003 and I've used the Sql DataAdapter Wizard to create a data connection, sql data adapter, stored procedures, and dataset in a winform. I can search and update okay but I get an error when I try to add a new record using the AddNew() Method against the dataset. Any help appreciated.


static void Main()
{
Application.Run(new Form1());
}

private void btnSearch_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.SelectCommand.Parameters["@Param2"].Value = txtBoxSPSearch.Text;
dsStaffPhysicians1.Clear();
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}

private void btnReset_Click(object sender, System.EventArgs e)
{
this.dsStaffPhysicians1.Clear();
ClearStaffPhysician();
}
private void SetupStaffPhysician()
{ //Initialize Staff Physician Page
panel1.Visible = true;
this.cBoxSPLicenseState.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", this.dsStaffPhysicians1, "tblStaffPhysicians.docLicenseState"));
}

private void ClearStaffPhysician()
{ //Clears textboxes and dropdowns
txtBoxSPFirstName.Text = "";
txtBoxSPMiddleName.Text = "";
txtBoxSPLastName.Text = "";
txtBoxSPUpin.Text = "";
txtBoxSPLicenseNumber.Text = "";
txtBoxSPSearch.Text = "";
cBoxSPLicenseState.SelectedIndex = 0;
}

private void menuItem2_Click(object sender, System.EventArgs e)
{ //Main menu -- Staff Physicians
SetupStaffPhysician();
menuItem2.Enabled = false;
}

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)
{
//Generates Error:System.Data.NoNullAllowedException
//Column 'docLName' does not allow nulls.
this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].AddNew();
}

private void menuItem3_Click(object sender, System.EventArgs e)
{
Application.Exit();
}

private void btnCommit_Click(object sender, System.EventArgs e)
{
//will need to do something here to commit insert
}


}
}
AnswerRe: System.Data.NoNullAllowedException Pin
Rob Graham4-Sep-05 5:48
Rob Graham4-Sep-05 5:48 
GeneralRe: System.Data.NoNullAllowedException Pin
rich_wenger4-Sep-05 8:24
rich_wenger4-Sep-05 8:24 
QuestionDatagrid Problem with PreferredColumnWidth Pin
surfman194-Sep-05 2:14
surfman194-Sep-05 2:14 
Question.NET Application books Pin
hcmuns4-Sep-05 1:57
susshcmuns4-Sep-05 1:57 
AnswerRe: .NET Application books Pin
Luis Alonso Ramos4-Sep-05 8:22
Luis Alonso Ramos4-Sep-05 8:22 
QuestionSending Access file through the network Pin
mohammad9293-Sep-05 22:40
mohammad9293-Sep-05 22:40 
QuestionRe: Sending Access file through the network Pin
Guffa3-Sep-05 23:10
Guffa3-Sep-05 23:10 
AnswerRe: Sending Access file through the network Pin
mohammad9293-Sep-05 23:42
mohammad9293-Sep-05 23:42 
AnswerRe: Sending Access file through the network Pin
Guffa4-Sep-05 0:17
Guffa4-Sep-05 0:17 
QuestionHow can I compile *.lib in VC++ to dll? Pin
uumeme3-Sep-05 22:16
uumeme3-Sep-05 22:16 
AnswerRe: How can I compile *.lib in VC++ to dll? Pin
if_mel_yes_else_no4-Sep-05 5:18
if_mel_yes_else_no4-Sep-05 5:18 
AnswerRe: How can I compile *.lib in VC++ to dll? Pin
Luis Alonso Ramos4-Sep-05 8:16
Luis Alonso Ramos4-Sep-05 8:16 
QuestionXML Serializer: circular reference due to public attribute? Pin
peterchen3-Sep-05 21:16
peterchen3-Sep-05 21:16 
AnswerRe: XML Serializer: circular reference due to public attribute? Pin
Mathew Hall3-Sep-05 21:35
Mathew Hall3-Sep-05 21:35 
GeneralRe: XML Serializer: circular reference due to public attribute? Pin
peterchen3-Sep-05 21:47
peterchen3-Sep-05 21:47 
GeneralRe: XML Serializer: circular reference due to public attribute? Pin
Judah Gabriel Himango4-Sep-05 11:47
sponsorJudah Gabriel Himango4-Sep-05 11:47 
GeneralRe: XML Serializer: circular reference due to public attribute? Pin
peterchen4-Sep-05 12:12
peterchen4-Sep-05 12: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.