Author: cicciofdl | Posted on: 9/26/2009 3:44:46 PM | Views : 367

Hi.
I've a class with one static void function...
Inside this function there's a code with one switch
... SqlConnection conn = new SqlConnection(Spedizionieri.Common.ConnString); conn.Open(); SqlCommand Mycommand = new SqlCommand(); Mycommand.CommandType = CommandType.Text; Mycommand.Connection = conn; foreach (DataRow riga in dtSCSstep1.Rows) { switch (Convert.ToInt32(riga["Tipo"])) { case 1: Mycommand.CommandText = "INSERT INTO ... VALUES ..."; Mycommand.ExecuteNonQuery(); Mycommand.CommandText = "INSERT INTO ... VALUES ..."; Mycommand.ExecuteNonQuery(); break; case 2: Mycommand.CommandText = "INSERT INTO ... VALUES ..."; Mycommand.ExecuteNonQuery(); Mycommand.CommandText = "INSERT INTO ... VALUES ..."; Mycommand. ...

Go to the complete details ...