| |

VerySource

 Forgot password?
 Register
Search
View: 580|Reply: 1

"Load" method does not take "4" parameter overload

[Copy link]

3

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-4 14:40:01
| Show all posts |Read mode
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.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 United States

Post time: 2020-1-8 12:09:01
| Show all posts
It has nothing to do with this code, but the parameters are wrong when you call it.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list