Good afternoon Everybody,
I need help - I want get row ID from datagridview in Form1 to the sqltable. But button for execute i have in Form2. And I don´t know how to connect Form1 and Form2. Example - I want write value in to the sql table - first is name and I want searching via ID. But Visual Studio has written - In order to use a non-static field, method, or property, you must first create an object instance. Can you help me?
{
string source4 = (@"Data Source=SRV01\SQLEXPRESS;Initial Catalog=ArburgSoft;Integrated Security=True");
SqlConnection con4 = new SqlConnection(source4);
con4.Open();
cmd4 = new SqlCommand("Update Souhrn Set program=@program where Id=" + Form1.dataGridView1.SelectedRows[0].Cells[0].Value.ToString() + , "");
`