title: Update the sqlite from datagrid using c#
body: <p>I am able to open the data grid connection , Now in data grid after opening i want to update particuar value through text box. But how should I update using grid.</p>
  
  <p>Below is the code</p>
  
  <pre><code>    private void button3_Click(object sender, EventArgs e)
      {
          SQLiteConnection connection4 = new SQLiteConnection(@"Data Source = C:\foo.sqlite;Version =3");
          connection4.Open();
          string sql2 = "Update Table set language1= '" + textBoxUpdate1.Text + "' where language1 = '" + textBox_Search.Text + "'";
          SQLiteDataAdapter connect4 = new SQLiteDataAdapter(sql2, connection4);
          DataSet ds4 = new DataSet();
          connect4.Fill(ds4);
          dataGridView.DataSource = ds4.Tables[0];
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/BWocg.png" alt="Data grid view"></p>
  
  <p>From the image i want to say that i want to update the language 2 , so i will type in the second text box where in the update statement i will set but "where" i want to choose where the user highlights in the data grid , below is the update table where datagrid selection is there , at that place i want data grid selected</p>
  
  <p>like</p>
  
  <pre><code>    string sql2 = "Update Table set language1= '" + textBoxUpdate1.Text + "' where language1 = '" + DATAGrid Selection + "'"; 
  </code></pre>
  
  <p>Is this possible?</p>