Click here to Skip to main content
15,918,275 members
Home / Discussions / C#
   

C#

 
GeneralRe: Close MessageBox automaticly Pin
MNFlyer21-Mar-08 11:17
MNFlyer21-Mar-08 11:17 
GeneralRe: Close MessageBox automaticly Pin
pcaeiro22-Mar-08 5:30
pcaeiro22-Mar-08 5:30 
QuestionHow to obtain external facing IP Address in C# Form Pin
PsychRich20-Mar-08 11:59
PsychRich20-Mar-08 11:59 
Questionhow to find location of an object Pin
netJP12L20-Mar-08 11:52
netJP12L20-Mar-08 11:52 
AnswerRe: how to find location of an object Pin
J$20-Mar-08 12:17
J$20-Mar-08 12:17 
AnswerRe: how to find location of an object Pin
Christian Graus20-Mar-08 12:54
protectorChristian Graus20-Mar-08 12:54 
AnswerRe: how to find location of an object Pin
Derek Bartram21-Mar-08 15:47
Derek Bartram21-Mar-08 15:47 
GeneralUpdating db using command builder or manualy Pin
baranils20-Mar-08 10:01
baranils20-Mar-08 10:01 
Hello

I'm already doing different updates in different tables using MySqlCommandbuilder and I don't have particular problems

BUT
For one dataset resulting of a query with joins, and needing only to uptate one column in one table the commandbuilder can't work
So I decide to build my own command as below

Unfortunately, it does not work too : everything seems ok, the update is returning a count but nothing change in the DB

So I decided to do everything manualy in a loop (second example) : It works.
But I'm still trying to understand why the first option is not working ?

/*<br />
     adaRit.UpdateCommand = new MySqlCommand("UPDATE tours SET order1=?order1 WHERE id=?id", MyConn.conn);<br />
     adaRit.UpdateCommand.Parameters.Add("?order1", MySqlDbType.Int32, 11, "order1").SourceVersion = DataRowVersion.Original;<br />
     adaRit.UpdateCommand.Parameters.Add("?id", MySqlDbType.Int32, 11, "id").SourceVersion = DataRowVersion.Original;<br />
     Step = adaRit.Update(dsRit);<br />
*/


Using a "manual" loop

      MySqlCommand cmd;<br />
      string xCmd;<br />
      DataTable dtr = dsRit.Tables[0];<br />
<br />
      for (int i = 0; i < dtr.Rows.Count; i++)<br />
      {<br />
        DataRow dr=dtr.Rows[i];<br />
        xCmd = "UPDATE tours SET order1=" + dr["order1"].ToString() + " WHERE id=" + dr["id"].ToString();<br />
        cmd=new MySqlCommand(xCmd, MyConn.conn);<br />
        int nUpd = cmd.ExecuteNonQuery();<br />
      }

GeneralC# Object Serialization Problem Pin
Jammer20-Mar-08 10:01
Jammer20-Mar-08 10:01 
GeneralRe: C# Object Serialization Problem Pin
ChrisKo20-Mar-08 11:19
ChrisKo20-Mar-08 11:19 
GeneralRe: C# Object Serialization Problem Pin
Jammer20-Mar-08 12:44
Jammer20-Mar-08 12:44 
QuestionHow to receive messages on the same socket sent from multiple UDP client using different ports? Pin
gix6520-Mar-08 8:43
gix6520-Mar-08 8:43 
GeneralRe: How to receive messages on the same socket sent from multiple UDP client using different ports? Pin
Paul Conrad21-Mar-08 10:04
professionalPaul Conrad21-Mar-08 10:04 
GeneralRecursive Generics for Fluent Interfaces [modified] Pin
TWang20-Mar-08 8:16
TWang20-Mar-08 8:16 
GeneralInstantiating Array of objects. Pin
Ravi Mahavrathayajula20-Mar-08 7:29
Ravi Mahavrathayajula20-Mar-08 7:29 
GeneralRe: Instantiating Array of objects. Pin
Russell Jones20-Mar-08 7:51
Russell Jones20-Mar-08 7:51 
GeneralRe: Instantiating Array of objects. Pin
Ravi Mahavrathayajula20-Mar-08 7:59
Ravi Mahavrathayajula20-Mar-08 7:59 
GeneralC# Used to send E-mail Pin
w20920-Mar-08 6:56
w20920-Mar-08 6:56 
GeneralRe: C# Used to send E-mail Pin
J4amieC20-Mar-08 7:20
J4amieC20-Mar-08 7:20 
GeneralRe: C# Used to send E-mail Pin
led mike20-Mar-08 8:16
led mike20-Mar-08 8:16 
QuestionCrystal reports with dynamic databases? Pin
Tammy Meister20-Mar-08 6:06
Tammy Meister20-Mar-08 6:06 
GeneralRe: Crystal reports with dynamic databases? Pin
Paul Conrad21-Mar-08 10:05
professionalPaul Conrad21-Mar-08 10:05 
Question[Message Deleted] Pin
Ravi Mahavrathayajula20-Mar-08 5:43
Ravi Mahavrathayajula20-Mar-08 5:43 
GeneralRe: Initializing the value of a 1d string to 2d string. Pin
CPallini20-Mar-08 5:49
mveCPallini20-Mar-08 5:49 
General[Message Deleted] Pin
Ravi Mahavrathayajula20-Mar-08 6:12
Ravi Mahavrathayajula20-Mar-08 6: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.