Hi there,
I caught your error..
Try this.
SqlConnection connection = new SqlConnection("Data Source= .\\SQLEXPRESS;"+
" Initial Catalog= zeit; integrated security = true");
SqlDataAdapter data = new SqlDataAdapter();
data.InsertCommand = new SqlCommand("insert into AbhängigkeitTabelle"+
" values("+
"Select V_ID from Netzplan where V_Name = '@VName')"+
",(select Vorgang_ID from Netzplan_2 where Abhängigkeiten ='@Ab' )", connection);
data.InsertCommand.Parameters.Add("@VName", SqlDbType.VarChar).Value = VorgangNameTextBox.Text;
data.InsertCommand.Parameters.Add("@Ab", SqlDbType.VarChar).Value = AbhängigkeitenTextBox.Text;
connection.Open();
data.InsertCommand.ExecuteNonQuery();
MessageBox.Show(" Datei eingefügt");
connection.Close();
This may help you.. All the best.