|
Anxious! !! !! !! !! !! 1
public DataTable Load (string connStr, int ClassID, int maxCount, int Abc)
{
// ??????
SqlConnection cnn;
SqlCommand cmd;
SqlDataAdapter dap;
DataSet dst;
Ranch
// ?????
cnn = new SqlConnection (connStr);
dst = new DataSet ();
if (ClassID == 0)
{
if (maxCount == 0)
{
cmd = new SqlCommand ("select ID, classID," + Convert.ToString ("Title"). Substring (1, Abc) + ", UpdateTime from News order by UpdateTime desc", cnn);
}
else
{
cmd = new SqlCommand ("select top" + maxCount.ToString () + "* from News", cnn);
}
}
else
{
if (maxCount == 0)
{
cmd = new SqlCommand ("select * from News where [ClassID] =" + ClassID.ToString () + "", cnn);
}
else
{
cmd = new SqlCommand ("select top" + maxCount.ToString () + "* from News where [ClassID] =" + ClassID.ToString () + "", cnn);
}
Ranch
}
dap = new SqlDataAdapter (cmd);
dap.Fill (dst, "News");
Ranch
cnn.Close (); // ?????
Ranch
// ????
return dst.Tables ["News"];
}
I'm a beginner. What is wrong with you? The "Load" method does not take "4" parameter overload. |
|