Código:
public void Form1_Load(object sender, EventArgs e) { string constr; constr = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\DataBases\\INSP_SIPA.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; SqlConnection con = new SqlConnection(constr); con.Open(); SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM ANOMALIASVS", con); DataSet ds = new DataSet(); da.Fill(ds, "VALSEC"); dataGridView1.DataSource = ds.Tables[0]; }