Hi guys how do I sort out this error = "object reference not set to an instance of an object"
try
{
String connection = "Data Source=(LocalDB)\\v11.0;AttachDbFilename=C:\\Users....";
SqlConnection conn = new SqlConnection(connection);
SqlCommand db = new SqlCommand("select * from Tbl", conn);
SqlCommandBuilder builder = new SqlCommandBuilder(da);
ds = new DataSet();
da.Fill(ds, "Tbl");
dataGridView1.DataSource = ds.Tables["Tbl"];
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}