Current location - Health Preservation Learning Network - Healthy weight loss - The overloaded method that ASP.NET C # best matches has some invalid parameters (about stored procedure calls).
The overloaded method that ASP.NET C # best matches has some invalid parameters (about stored procedure calls).
Obviously, the parameter of the GetDataTable method is string, and you wrote this sentence.

Data table dt= db. GetDataTable(db。 GetCommandProc(" sys _ reg _ all "));

Yes, a parameter of type SqlCommand was passed. Parameter types do not match, so an error must be reported.

You can modify the GetTabaTable method or override it as follows:

Common data table GetDataTable(SqlCommand sc)

{

sqldata adapter da = new sqldata adapter(sc);

DataTable dt = new DataTable();

Da. Fill (dt);

Return dt;

}

Then you run your first code, which should probably pass, but even if it passes, I think there is something wrong with your overall logical structure, which should be adjusted again.