对象引用未设置为object.C#asp的实例

时间:2016-04-28 14:59:42

标签: c# asp.net sql-server-2008

Line 19:     
static BalloonShopConnectionString1()

Line 20:  
   {

Line 21:
         dbConnectionString = ConfigurationManager.ConnectionStrings["BalloonShopConnection"].ConnectionString;

Line 22:
         dbProviderName = ConfigurationManager.ConnectionStrings["BalloonShopConnection"].ProviderName;

Line 23:         productsPerPage = System.Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]);

Line 21 Error

1 个答案:

答案 0 :(得分:0)

如果你的web.config中没有定义BalloonShopConnection,那么

null引用可能发生在21或22上