Sei sulla pagina 1di 1

public partial class Form1 : Form

{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{
SqlConnection cnx = new SqlConnection(@"Data Source=DESKTOP-M700LJF;Initial
Catalog=CasRDACO;Integrated Security=True");
cnx.Open();
SqlCommand cmd = new SqlCommand("select *from Client",cnx);
SqlDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
dataGridView1.DataSource = dt;
cnx.Close();
}
}
}

Potrebbero piacerti anche