private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Fellipe\\documents\\visual studio 2010\\Projects\\WindowsFormsApplication2\\WindowsFormsApplication2\\PUBS.MDF;Integrated Security=True;Connect Timeout=30;MultipleActiveResultSets=True;User Instance=True";
SqlConnection conexao = new SqlConnection(strcon);
conexao.Open();
SqlDataAdapter Buscar = new SqlDataAdapter("SELECT ROTA, DOCA FROM Planilha4 WHERE D2 =" + monthCalendar1.SelectionStart.ToString("dd/MM/yyyy"), conexao);
DataTable dt = new DataTable();
Buscar.Fill(dt);
SqlDataAdapter sda = new SqlDataAdapter();
BindingSource bSource = new BindingSource();
bSource.DataSource = dt;
dataGridView1.DataSource = bSource;
sda.Update(dt);
}
The error is thrown at Buscar.Fill(dt);
I would like to eliminate this error. I'm waiting for the reply.
Thanks