Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help: Invalid Parameter Used error Pin
nudma12-Aug-08 6:03
nudma12-Aug-08 6:03 
GeneralRe: Help: Invalid Parameter Used error Pin
Rashmi_Karnam13-Aug-08 4:04
Rashmi_Karnam13-Aug-08 4:04 
GeneralRe: Help: Invalid Parameter Used error Pin
nudma13-Aug-08 4:36
nudma13-Aug-08 4:36 
GeneralRe: Help: Invalid Parameter Used error Pin
Rashmi_Karnam13-Aug-08 9:57
Rashmi_Karnam13-Aug-08 9:57 
GeneralRe: Help: Invalid Parameter Used error Pin
nudma14-Aug-08 4:43
nudma14-Aug-08 4:43 
QuestionString or binary data would be truncated. The statement has been terminated. Pin
laziale12-Aug-08 3:47
laziale12-Aug-08 3:47 
AnswerRe: String or binary data would be truncated. The statement has been terminated. Pin
vikas amin12-Aug-08 5:28
vikas amin12-Aug-08 5:28 
Questionrowchanged event and update error Pin
catborise12-Aug-08 3:10
catborise12-Aug-08 3:10 
i am trying to take under control of changing datarows. when there is a change i want to ask user whether he/she wants to save changes or discard changes. to accomplish this i am using rowchanged event

private void Form1_Load(object sender, EventArgs e)
{
     this.kisiTableAdapter.Fill(this.denekDataSet.Kisi);
   
     denekDataSet.Kisi.KisiRowChanged += new denekDataSet.KisiRowChangeEventHandler(Kisi_KisiRowChanged);

}


void Kisi_KisiRowChanged(object sender, denekDataSet.KisiRowChangeEvent e)
        {
            DataRowAction drc = e.Action;
            if (drc == DataRowAction.Change)
            {
                DialogResult dr = MessageBox.Show("do you want to save changes!", "warning", MessageBoxButtons.YesNo);
                if (dr == DialogResult.No)
                {
                    e.Row.RejectChanges();

                }
     
            }
        }


when there is a change this event works. and if user choice is "no" it works perfectly. but dialog result is "yes", there is a problem appears. changes are not apply to the database(restart the program). everything same as before the change action.

i tried different ways but it causes different errors(exception).

void Kisi_KisiRowChanged(object sender, denekDataSet.KisiRowChangeEvent e)
        {
            DataRowAction drc = e.Action;
            if (drc == DataRowAction.Change)
            {
                DialogResult dr = MessageBox.Show("do you want to save changes!", "warning", MessageBoxButtons.YesNo);
                if (dr == DialogResult.No)
                {
                    e.Row.RejectChanges();

                }else 
                {
                   kisiTableAdapter.Update(denekDataSet.Kisi);
                }

     
            }
        }


after changing it calls many times messagebox for asking choice then produces InvalidOperationException and stops.

how can i solve this problem, it makes me anger and tired.

please help me , or show me a different way.

my intention is tracking changes and asking right question.

thanks for interests

::CTBRS::

AnswerRe: rowchanged event and update error Pin
catborise13-Aug-08 1:53
catborise13-Aug-08 1:53 
QuestionNeed Help Calling A Fortran 77 (.for) DLL Pin
Nitusa12-Aug-08 3:03
Nitusa12-Aug-08 3:03 
QuestionRegistering to an event on a wcf web service Pin
Lior Zat12-Aug-08 2:37
Lior Zat12-Aug-08 2:37 
AnswerRe: Registering to an event on a wcf web service Pin
c242312-Aug-08 3:47
c242312-Aug-08 3:47 
GeneralRe: Registering to an event on a wcf web service Pin
Lior Zat13-Aug-08 20:17
Lior Zat13-Aug-08 20:17 
Questionhow can i resolve System.Collections.ListDictionaryInternal Pin
koolprasad200312-Aug-08 2:26
professionalkoolprasad200312-Aug-08 2:26 
AnswerRe: how can i resolve System.Collections.ListDictionaryInternal Pin
leppie12-Aug-08 2:30
leppie12-Aug-08 2:30 
Questionenumeration of Active Sockets Pin
damcg12-Aug-08 2:07
damcg12-Aug-08 2:07 
AnswerRe: enumeration of Active Sockets Pin
leppie12-Aug-08 2:28
leppie12-Aug-08 2:28 
GeneralRe: enumeration of Active Sockets Pin
damcg12-Aug-08 3:01
damcg12-Aug-08 3:01 
GeneralRe: enumeration of Active Sockets Pin
leppie12-Aug-08 3:12
leppie12-Aug-08 3:12 
GeneralRe: enumeration of Active Sockets Pin
damcg12-Aug-08 3:55
damcg12-Aug-08 3:55 
QuestionIntermittent Code behind Errors in C#.net Pin
AnuVM12-Aug-08 1:53
AnuVM12-Aug-08 1:53 
AnswerRe: Intermittent Code behind Errors in C#.net Pin
Christian Graus12-Aug-08 1:57
protectorChristian Graus12-Aug-08 1:57 
QuestionURL escape issue Pin
George_George12-Aug-08 1:13
George_George12-Aug-08 1:13 
AnswerRe: URL escape issue Pin
Christian Graus12-Aug-08 1:56
protectorChristian Graus12-Aug-08 1:56 
GeneralRe: URL escape issue Pin
George_George12-Aug-08 1:59
George_George12-Aug-08 1:59 

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.