How to implement look up in SQL Server 2014 + Visual Studio 2015?

When I pull a field from another table in VS2015 in the constructor, the insert , update ! Methods are not created.

When I manually write the update method and the Insert method, it cannot update and add data to this field, as it is from another table. Code for these methods in VS2015

insert method.

 string sqlQ = "INSERT INTO Klient ( Fio, ID_TS, NumberTS, Number_Tel, Naimenovanie_TS) VALUES (@param1, @param2, @param3,@param4,@param5)"; using (SqlCommand comand = new SqlCommand(sqlQ, db)) { Form2 F = new Form2(); comand.Parameters.AddWithValue("@param1", textBox1.Text); comand.Parameters.AddWithValue("@param2", comboBox1.Text); comand.Parameters.AddWithValue("@param3", textBox2.Text); comand.Parameters.AddWithValue("@param4",comboBox2.Text); comand.Parameters.AddWithValue("@param5", textBox3.Text); try { comand.ExecuteNonQuery(); F = (Form2)this.Owner; F.button4_Click(sender, e); Close(); } catch { } 

Immediately after launch, it swears at the 'Naimenovanie_TS' field that it is missing.

  • For clarity, add to the question the code that you are writing and explain what exactly you cannot do. - Denis Bubnov
  • So many amendments are not one answer)) figured out who will be interested in writing - SemSerios777

0