I read this post to try and solve why I get this error message, but it didn't work.
Can any one help/advise me? Here is the function that causes the error:
public String getOnTimeNames()
{
try
{
String mConn = "Data Source = San-SQL; Initial Catalog = OnTimeTesting; Integrated Security = True; Max Pool Size = 500";
String tSQL = "SELECT dbo.Defects.DefectId AS OnTimeID, dbo.Defects.Name AS Name FROM dbo.Defects INNER JOIN dbo.Projects ON dbo.Defects.ProjectId = dbo.Projects.ProjectId WHERE (dbo.Projects.ParentId = 126) ORDER BY dbo.Defects.DefectId DESC";
SqlConnection wConn = new SqlConnection(mConn);
SqlCommand mCmd = new SqlCommand(tSQL, wConn);
wConn.Open();
//readers for the data
SqlDataReader Reader = mCmd.ExecuteReader();
while (Reader.Read())
{
OnTime_Name = (String)Reader["Name"];
return OnTime_Name;
}
wConn.Close();
}
catch(ArgumentException )
{
return "An error occured whilst processing your request. Details follow: " ;
}
}
Thanks,
Newbie19