mi codigo en c#
Código:
espero y me puedan ayudar de antemano gracias int fk = int.Parse(comboBox1.SelectedValue.ToString());
SqlConnection conexion = new SqlConnection(csConexiones.cadConexion);
conexion.Open();
string seleccion = "select s.Descripcion, ts.Descripcion, ts.Costo from Servicios as s join TipoServicios as ts on s.IdServicio = ts.ServicioId where ts.IdTipoServicio =" + fk;
try
{
SqlCommand comando = new SqlCommand(seleccion, conexion);
SqlDataReader lector = comando.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(lector);
dataGridView1.DataSource = dt;
}
catch
{
MessageBox.Show("ocurrio un error");
}
finally
{
conexion.Close();
}
. 


