0

Under is my method to fill a dataset, when i run it i get this exception: Object reference not set to an instance of an object. but the same working fine in vb.net

public void LoadTxt(DataSet Ds, String qry)
{
    try
    {
        Ds.Tables.Clear();
        Da = new SqlDataAdapter(qry, con);
        Da.Fill(Ds);
    }
    catch (Exception)
    {
        throw;
    }
}

0 Answers0