|
The following piece of code appears:
"System.InvalidCastException: The specified conversion is invalid."
Troubleshooting tips:
"When a number is coerced, the value must be a number less than infinity
Make sure the source type can be converted to the target type "
Ask for help, give points immediately, if the explanation is clear to everyone, I am willing to add points!
public IList <Bbs_PostDetailsInfo> GetPostDetails (string postid)
{
IList <Bbs_PostDetailsInfo> postlist = new List <Bbs_PostDetailsInfo> ();
strSql = "SELECT * FROM V_Bbs_PostDetails WHERE Post_Id =" + postid;
sdr = GetDataReader (strSql);
while (sdr.Read ())
{
postlist.Add (new Bbs_PostDetailsInfo (sdr.GetInt32 (0), sdr.GetString (1), sdr.GetString (2), sdr.GetInt32 (3),
sdr.GetString (4), sdr.GetString (5), sdr.GetDateTime (6), sdr.GetInt32 (7), sdr.GetString (8), sdr.GetDateTime (9),
sdr.GetString (10), sdr.GetString (11), sdr.GetString (12), sdr.GetString (13), sdr.GetString (14), sdr.GetString (15),
sdr.GetInt32 (16), sdr.GetInt32 (17), sdr.GetInt32 (18), sdr.GetInt32 (19), sdr.GetInt32 (20), sdr.GetInt32 (21),
sdr.GetString (22), sdr.GetDateTime (23), sdr.GetInt32 (24), sdr.GetInt32 (25), sdr.GetString (26), sdr.GetInt32 (27), sdr.GetInt32 (28), sdr .GetInt32 (29)));
}
sdr.Close ();
sdr.Dispose ();
return postlist;
} |
|