Click here to Skip to main content
11,408,708 members (64,180 online)
   

C#

 
GeneralRe: Running .exe in windows form but it opens an external window Pinmemberdusty_dex18-Mar-13 3:55 
GeneralRe: Running .exe in windows form but it opens an external window Pinmembertoms from newdelhi18-Mar-13 4:28 
GeneralRe: Running .exe in windows form but it opens an external window [modified] Pinmemberdusty_dex18-Mar-13 6:07 
AnswerRe: Running .exe in windows form but it opens an external window PinmemberVasudevan Deepak Kumar18-Mar-13 10:12 
Questionwhat is the meaning of this? Syntax error in UPDATE statement. Pinmemberkruczynski12316-Mar-13 19:43 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. PinmemberPIEBALDconsult16-Mar-13 20:23 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. PinmvpRichard MacCutchan16-Mar-13 23:11 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. PinmvpOriginalGriff16-Mar-13 23:54 
GeneralRe: what is the meaning of this? Syntax error in UPDATE statement. PinmemberPIEBALDconsult17-Mar-13 11:45 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. PinmvpAbhinav S18-Mar-13 7:37 
QuestionConnection between two forms in a project Pinmembercoolvibhu16-Mar-13 7:18 
AnswerRe: Connection between two forms in a project PinmemberThePhantomUpvoter16-Mar-13 7:36 
AnswerRe: Connection between two forms in a project PinmvpOriginalGriff16-Mar-13 7:40 
QuestionListBox datasource is not updated on first click Pinmemberzulfakar16-Mar-13 4:24 
i create a winform program that load the data from ms access database to my listbox. when i click my item which i want to update on database and datasource on my listbox and click the update button, the item just wont update for the first time clicked but the second does, so everytime i need to modify my data i need to choose my item and click the update button two times. that's is crazy lol..

private void buttonUpdate_Click(object sender, EventArgs e)
    {
        //update the database
        OleDbDataAdapter cmd = new OleDbDataAdapter();
        cmd.UpdateCommand = new OleDbCommand("UPDATE Item SET ITEM = @ITEM, ITEM_DESC = @ITEM_DESC WHERE ID = @ID",GetConnection());
        cmd.UpdateCommand.Parameters.AddWithValue("@ITEM", textBoxITEM.Text);
        cmd.UpdateCommand.Parameters.AddWithValue("@ITEM_DESC", textBoxITEMDESC.Text);
        cmd.UpdateCommand.Parameters.AddWithValue("@ID", Convert.ToInt32(textBoxID.Text));
        cmd.UpdateCommand.ExecuteNonQuery();
 
        // update the datasource
        _productlist.Clear();
        listBox1.DataSource = null;
        listBox1.Items.Clear();
        Fill();
        listBox1.Update();
    }

basic thing that happen:

1. load data to listbox with databind to textbox
2. click item on my listbox and modify data from textbox
3. click the update button to update database and datasource
4. datasource not update for the first time but database does update
5. repeat no.2
6. repeat no.3
7. datasource updated

what i want:

1. load data to listbox with databind to textbox
2. click item on my listbox and modify data from textbox
3. click the update button to update database and datasource
4. datasource and database updated

how do i fix this bug on my application?? please let me know if i need to be more clear..
AnswerRe: ListBox datasource is not updated on first click PinmemberJegan Thiyagesan16-Mar-13 14:31 
GeneralRe: ListBox datasource is not updated on first click Pinmemberzulfakar17-Mar-13 9:24 
GeneralRe: ListBox datasource is not updated on first click [modified] PinmemberJegan Thiyagesan18-Mar-13 4:50 
QuestionExporting Gridview with fixed number of rows on each page PinmemberAlexRusso16-Mar-13 2:18 
AnswerRe: Exporting Gridview with fixed number of rows on each page PinmvpEddy Vluggen16-Mar-13 13:06 
GeneralRe: Exporting Gridview with fixed number of rows on each page PinmemberAlexRusso18-Mar-13 1:57 
GeneralRe: Exporting Gridview with fixed number of rows on each page PinmvpEddy Vluggen18-Mar-13 2:29 
QuestionFilesystemwatcher causes exception. Pinmemberleone15-Mar-13 7:32 
AnswerRe: Filesystemwatcher causes exception. PinmemberJibesh15-Mar-13 7:53 
GeneralRe: Filesystemwatcher causes exception. Pinmemberleone15-Mar-13 12:03 
GeneralRe: Filesystemwatcher causes exception. PinmemberJibesh15-Mar-13 12:09 
GeneralRe: Filesystemwatcher causes exception. PinmvpDave Kreskowiak15-Mar-13 13:44 
AnswerRe: Filesystemwatcher causes exception. PinmvpEddy Vluggen15-Mar-13 8:47 
QuestionC# file exists on network drive Pinmemberclassy_dog15-Mar-13 3:44 
AnswerRe: C# file exists on network drive Pinmembers_magus15-Mar-13 4:07 
GeneralRe: C# file exists on network drive PinmvpRichard MacCutchan15-Mar-13 8:19 
GeneralRe: C# file exists on network drive PinmvpEddy Vluggen15-Mar-13 8:48 
GeneralRe: C# file exists on network drive PinmvpRichard MacCutchan15-Mar-13 8:56 
GeneralRe: C# file exists on network drive PinmvpEddy Vluggen15-Mar-13 9:07 
AnswerRe: C# file exists on network drive PinmvpRichard MacCutchan15-Mar-13 8:28 
GeneralRe: C# file exists on network drive Pinmemberclassy_dog15-Mar-13 9:28 
QuestionIf existing String Form name, get that by database then open PinmemberJayantha Bandara15-Mar-13 1:37 
AnswerRe: If existing String Form name, get that by database then open PinmvpRichard MacCutchan15-Mar-13 2:02 
AnswerRe: If existing String Form name, get that by database then open PinprotectorPete O'Hanlon15-Mar-13 2:12 
GeneralRe: If existing String Form name, get that by database then open PinmemberV.15-Mar-13 4:44 
GeneralRe: If existing String Form name, get that by database then open PinmemberMycroft Holmes15-Mar-13 14:39 
QuestionResolving dependent projects PinmemberBernhard Hiller15-Mar-13 1:15 
AnswerRe: Resolving dependent projects PinprotectorPete O'Hanlon15-Mar-13 2:38 
Questionsubstring from form1 to form2.... PinmemberGoaty6510914-Mar-13 18:15 
AnswerRe: substring from form1 to form2.... PinmemberJibesh14-Mar-13 18:35 
GeneralRe: substring from form1 to form2.... PinmemberGoaty6510914-Mar-13 19:57 
QuestionBlueTooth Bytes Disappearing PinmemberC-P-User-314-Mar-13 14:03 
QuestionView in Nhibernate Pinmemberhadi_ganji14-Mar-13 7:06 
AnswerRe: View in Nhibernate - Repost PinmvpRichard MacCutchan14-Mar-13 7:24 
QuestionUnable to set registry value Pinmembersjs4u13-Mar-13 22:27 
AnswerRe: Unable to set registry value Pinmemberdusty_dex14-Mar-13 6:07 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 24 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid