问题描述
行70:行71://Executethecommand行72:myConnection.Open();行73:SqlDataReaderresult=myCommand.ExecuteReader(CommandBehavior.CloseConnection);行74publicSqlDataReaderGetProductCategories(){//CreateInstanceofConnectionandCommandObjectSqlConnectionmyConnection=newSqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);SqlCommandmyCommand=newSqlCommand("CMRC_ProductCategoryList",myConnection);//MarktheCommandasaSPROCmyCommand.CommandType=CommandType.StoredProcedure;//ExecutethecommandmyConnection.Open();(这里提示为初始化错误)SqlDataReaderresult=myCommand.ExecuteReader(CommandBehavior.CloseConnection);//Returnthedatareaderresultreturnresult;}怎么回事呢
解决方案
解决方案二:
提示未初始化
时间: 2024-10-18 04:28:30