K
Keith Patrick
I've seen people have this issue before, but it has always been intermittent for folks. Mine isn't (some students do work, but several cause the exception every single time). What goes on is that I try to pull up data on a student, but when DbDataAdaptor.Fill is called, I get the exception. It's buried so deep, I can't figure out the cause. I'd even be happy with some nudge in the right direction on where to look, as it's just too deep in the system for me to figure out. Every single time I grab the same
Here's my code:
SqlConnection con = null;
StudentProfileDS _studentDS = new StudentProfileDS();
SqlDataAdapter da = null;
try
{
con = new SqlConnection(ObjectConnectString);
con.Open();
cmd.Connection = con;
da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.TableMappings.Add("Table", "Detail");
da.TableMappings.Add("Table1", "EnrollmentHistory");
da.TableMappings.Add("Table2", "AtRiskHistory");
da.TableMappings.Add("Table3", "LEPHistory");
da.TableMappings.Add("Table4", "GradesHistory");
da.TableMappings.Add("Table5", "Attendance");
da.TableMappings.Add("Table6", "Schedule");
da.TableMappings.Add("Table7", "Stanford");
da.TableMappings.Add("Table8", "RPTE");
da.TableMappings.Add("Table9", "HFW");
da.Fill( _studentDS ); // Here's where the exception occurs
return _studentDS;
}
catch (Exception ex)
{
throw ex;
}
finally
{
con.Close();
con.Dispose();
con = null;
da.Dispose();
da = null;
}
Here's my code:
SqlConnection con = null;
StudentProfileDS _studentDS = new StudentProfileDS();
SqlDataAdapter da = null;
try
{
con = new SqlConnection(ObjectConnectString);
con.Open();
cmd.Connection = con;
da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.TableMappings.Add("Table", "Detail");
da.TableMappings.Add("Table1", "EnrollmentHistory");
da.TableMappings.Add("Table2", "AtRiskHistory");
da.TableMappings.Add("Table3", "LEPHistory");
da.TableMappings.Add("Table4", "GradesHistory");
da.TableMappings.Add("Table5", "Attendance");
da.TableMappings.Add("Table6", "Schedule");
da.TableMappings.Add("Table7", "Stanford");
da.TableMappings.Add("Table8", "RPTE");
da.TableMappings.Add("Table9", "HFW");
da.Fill( _studentDS ); // Here's where the exception occurs
return _studentDS;
}
catch (Exception ex)
{
throw ex;
}
finally
{
con.Close();
con.Dispose();
con = null;
da.Dispose();
da = null;
}