Filtering DataGridView that is connectec to SQL problem

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi guys, I have this code and it stops without saying anything, may someone help me ?
It should be code for filtering.private void start_Load(object sender, EventArgs e)
{
DataTable datatable = new DataTable();
SqlConnection mojespojeni = new SqlConnection("Data Source=MAREK-NB\SQLEXPRESS;Initial Catalog=connection_tests;Integrated Security=True");

mojespojeni.Open();

datatable.Load(new SqlCommand("SELECT * FROM clients_esp", mojespojeni).ExecuteReader());

mojespojeni.Close();
dataGridView1.DataSource = zobraz = datatable.DefaultView;

View the full article
 
Back
Top