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.