I have this in a public class:
SqlConnection myConnection = new SqlConnection(\"Data Source=hermes;database=qcvalues; Integrated Security=SSPI;\"); myConnect
If your SelectCommand is stored procedure, the Fill method of the adapter will rise exception.
In these cases you can use:
DataTable dt = new DataTable(); dt = sdr.GetSchemaTable(); dt.Constraints.Clear(); dt.BeginLoadData(); dt.Load(sdr); //dt.EndLoadData(); // Enables constraints again