Search code examples
asp.netsqlhelper

What is going on in this ExecuteDataset method?


OK so I one page I find this line:

objDsCourse = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings("connstr").ConnectionString, CommandType.StoredProcedure, "Course_NewReportGet_Get_Sav", objPAra)

And I copied it to another page to start modifying it to work there:

getData = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings("connstr").ConnectionString, CommandType.StoredProcedure, "Course_NewReportGet_Get_Sav", objPAra)

However on the new page it underlines .ConnectionStrings saying that Non-invocable member 'System.Configuration.ConfigurationManager.ConnectionStrings' cannot be used like a method'... then why did it work in the other page??

EDIT: OK so I found in web.config what I think it is referencing because it says

<add name="ConnStr" connectionString="data source=..." />

Why would one page have access to this and the other not?


Solution

  • Is there any chance one page is using VB.NET, while the other is using C#?