SqlConnection conn = new SqlConnection (MyConection); Conex. Open (); SqlCommand comand = new SqlCommand (); comand.CommandText = "Select FROM TableX values"; comand.Connection = conn; DrTest comand.ExecuteReader SqlDataReader = (); / / create the list List <string> myValues = new List (); / / Fill the list with values from the Bd while (drTest.Read ()) { myValues. Add (drTest ["values"]. ToString ()); }
foreach(string item in myValues ) { var value=item; //insert the value to db here }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)