很简单的2行代码:
CacheOper co = new CacheOper();
DataTable dt = co.GetUserFuncsFir("3");
就是从缓存中读取数据,co.GetUserFuncsFir("3")返回的就是一个DataTable,ddl重新生成添加了无数次,就是报这个错误:
Server Error in '/WebFrame' Application.
Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.