The problem with entering data through insert into select is the next piece of code
foreach (XElement anElement in xdoc.Element("ЗАКАЗЫ").Elements("Заказ")) { XElement dateElemet = anElement.Element("ДатаЗаказа"); XElement id_uniElement = anElement.Element("НомерЗаказа"); XElement nameElement = anElement.Element("ФИО"); XElement ageElement = anElement.Element("Возраст"); XElement maleElement = anElement.Element("Пол"); XElement pregElement = anElement.Element("СрокОт"); XElement codeElement = anElement.Element("Код"); XElement localElement = anElement.Element("Примечание"); XElement bioElement = anElement.Element("Биоматериал"); XElement id_tubeElement = anElement.Element("НомерИсследования"); string date = dateElemet.Value; string id_uni = id_uniElement.Value; string pat_name = nameElement.Value; string age = ageElement.Value; string code_uni = codeElement.Value; string id_tube = id_tubeElement.Value; id_tube = id_tube = id_tube.Remove(0, 2);//обрезаем 25 в номере пробирки string validate = "g"; string biomat = bioElement.Value; if (localElement == null) { if (maleElement == null) { OleDbCommand command = new OleDbCommand(); command.Parameters.AddWithValue("id_uni", id_uni); command.Parameters.AddWithValue("id_tube", id_tube); command.Parameters.AddWithValue("biomat", biomat); command.Parameters.AddWithValue("pat_name", pat_name); command.Parameters.AddWithValue("age", age); command.Parameters.AddWithValue("validate", validate); command.Parameters.AddWithValue("code_uni", code_uni); command.Parameters.AddWithValue("date", date); command.Connection = con; con.Open(); command.CommandText = "insert into result (id_uni,date_in,code_uni,id_tube,pat_name,age,validate_result,biomat,san_numb) select @id_uni,@date_in,@code_uni,@id_tube,@pat_name,@age,@validate_result,@biomat,san_numb from san_vac where id_uni='1990'"; command.ExecuteNonQuery(); con.Close(); } however, when executing the code in the result table, the data is placed in the wrong fields. In which direction to look? Maybe there is some kind of "underwater stone"?