Re: ExecuteNonQuery stops program
From: rafal (rx409_at_gazeta.pl)
Date: 01/16/05
- Next message: Joe: "Re: Performace problem with DataView.RowFilter"
- Previous message: David Jessee: "Re: Approximating Decimal Type consistency from DB to .NET"
- In reply to: Sahil Malik: "Re: ExecuteNonQuery stops program"
- Next in thread: Sahil Malik: "Re: ExecuteNonQuery stops program"
- Reply: Sahil Malik: "Re: ExecuteNonQuery stops program"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 16 Jan 2005 23:32:59 +0100
Użytkownik "Sahil Malik" <contactmethrumyblog@nospam.com> napisał w
wiadomości news:uivGzOA$EHA.1452@TK2MSFTNGP11.phx.gbl...
> Are these commands a part of a transaction?
>
> - Sahil Malik
> http://dotnetjunkies.com/weblog/sahilmalik
>
>
> "rafal" <rx409@gazeta.pl> wrote in message
> news:csecfr$50q$1@inews.gazeta.pl...
> > I run this code below which is part of method.
> > ds.Tables["tabelka"].Rows.Count has always value 13117 but sometimes the
> > code executes only 1000 or 12000 times etc and freezes without error or
> > exception not coming to the end of the method. In debug window it prints
> > "before" which means it stops during or before executing
> > upd.ExecuteNonQuery();
> > I don' know what is going on. Thanks for help.
> >
> >
> > for (int y = 0; y < ds.Tables["tabelka"].Rows.Count; y++)
> > {
> > string account_id = ds.Tables["tabelka"].Rows[y][0].ToString();
> > string date = ds.Tables["tabelka"].Rows[y][1].ToString();
> > int temp1 = 0;
> > double temp2 = 0.00;
> > int val = 0;
> > val = y/1874;
> > string updateCommand = "update wielka set
"+columnName+"="+val.ToString()+
> > "
> > where account_id="+account_id+" and date="+date;
> > SqlConnection sqlConnection3 = new SqlConnection(connString);
> > SqlCommand upd = new SqlCommand(updateCommand, sqlConnection3);
> > if (sqlConnection3.State.ToString() == "Closed")
> > {
> > sqlConnection3.Open();
> > }
> > try
> > {
> > Console.WriteLine("before");
> > upd.ExecuteNonQuery();
> > Console.WriteLine("discretization "+y);
> > }
> > catch (Exception exc)
> > {
> > Console.WriteLine("Exception 3: "+exc.ToString());
> > Console.WriteLine("UpdateCommand: "+updateCommand);
> > }
> > sqlConnection3.Close();
> > }
> >
> >
>
>
No, separate inserts into database.
- Next message: Joe: "Re: Performace problem with DataView.RowFilter"
- Previous message: David Jessee: "Re: Approximating Decimal Type consistency from DB to .NET"
- In reply to: Sahil Malik: "Re: ExecuteNonQuery stops program"
- Next in thread: Sahil Malik: "Re: ExecuteNonQuery stops program"
- Reply: Sahil Malik: "Re: ExecuteNonQuery stops program"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|