get row values on datagrid
-
hi all , i use this code to fill datagrid with data from my database
private void btn_by_Click(object sender, EventArgs e)
{DataTable dt = new DataTable(); SqlConnection con = new SqlConnection("Data Source=MS-TOSHIBA;Initial Catalog=dalily system;Integrated Security=True"); SqlCommand cmd = new SqlCommand("select place.name,place.address,place.telephone,place.website,place.email,place.info from place,subcateogry where place.subcat_id=subcateogry.id And subcateogry.name='" + subcat_comboBox.SelectedItem.ToString() + "' ", con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); con.Close(); } now i want when i click on row select coordinate_x & coordinate_y from place table where name is in row i clicked on And store coordinate_x & coordinate_y as double thanks in advance
-
hi all , i use this code to fill datagrid with data from my database
private void btn_by_Click(object sender, EventArgs e)
{DataTable dt = new DataTable(); SqlConnection con = new SqlConnection("Data Source=MS-TOSHIBA;Initial Catalog=dalily system;Integrated Security=True"); SqlCommand cmd = new SqlCommand("select place.name,place.address,place.telephone,place.website,place.email,place.info from place,subcateogry where place.subcat_id=subcateogry.id And subcateogry.name='" + subcat_comboBox.SelectedItem.ToString() + "' ", con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); con.Close(); } now i want when i click on row select coordinate_x & coordinate_y from place table where name is in row i clicked on And store coordinate_x & coordinate_y as double thanks in advance
Just stop posting the same question twice in a row. There's no need and you're not drawing any more attention to your question. You're drawing it to yourself and not in a good light either.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Just stop posting the same question twice in a row. There's no need and you're not drawing any more attention to your question. You're drawing it to yourself and not in a good light either.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
i don't want to do that but there is a problem with my browser so when i click post nothing happen so i think my question not posted :)
Then you can check to see if it has been posted before doing it again.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak