API
Version 7.x > API > Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found. View modes: 
User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 4/19/2013 1:55:15 PM
   
Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.
I'm making a simple Console App using the Kentico API for a new client. Using this simple code snippet.


CMSContext.Init();
SiteInfo site = SiteInfoProvider.GetSiteInfo(1);
SiteInfoProvider.CurrentSiteID = site.SiteID;
SiteInfoProvider.CurrentSiteName = site.SiteName;


This in my app.config. I removed the client's information.


<add name="CMSConnectionString" connectionString="Persist Security Info=False;database=****;server=****;user id=****;password=****;Current Language=English;Connection Timeout=240;" />


I am getting this error: [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.

http://screencast.com/t/CxWHDeY9

Per other forum posts, I have done a complete reinstall and it has not helped at all. One thing that was weird is my version is 7.0.4640, which seems to be ahead of the hotfix version numbers.

Please help, my client is expecting this ASAP and I cannot continue. Thanks!

User avatar
Kentico Support
Kentico Support
kentico_radekm - 4/20/2013 5:27:42 AM
   
RE:Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.
Hello.

The number 7.0.4640 represents basic build, so it seems no hotfix has been actually applied.

As for the problem, I believe it is the GetSiteInfo method which causes this problem. This method queries database and uses cms.site.selectall query name. Could you please check and confirm that the database, over which you run this query (i.e. call the method) is standard KCMS DB and contains this query name? Thank you.

Best Regards,
Radek Macalik

User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 4/22/2013 8:03:29 AM
   
RE:Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.
Hi Radek:

select * from CMS_Query where QueryName like '%cms.site.selectall%' returns nothing. Why would that be? This happened once, I reinstalled Kentico and it happened again. Is my query correct?

User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 4/22/2013 12:51:15 PM
   
RE:Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.
My client spun up a new VM of Windows Server 2008 R2. Downloaded and Installed Kentico. Pointed my console application to the new database that was created and I saw absolutely no change.

Please let me know, my client needs this as soon as possible.

Thank you.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/22/2013 1:17:22 PM
   
RE:Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.
Hi,

That query existed in v6. I do not see it in my v7 database (You should get the ClassID first and then check the queries for given class:
SELECT [ClassID]
,[ClassDisplayName]
,[ClassName]
FROM [CMS_Class]
WHERE ClassName LIKE '%cms.site%'
and
select * from CMS_Query where ClassID = 52
).

How was the CMS and database installed? What are the values for CMSHotfixVersion, CMSDataVersion and CMSDBversion in your database? (SELECT KeyName, KeyValue
FROM [CMS_SettingsKey]
WHERE KeyName LIKE '%version%')

Best regards,
Juraj Ondrus

User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 4/22/2013 1:19:32 PM
   
RE:Cannot obtain SiteInfo. [SqlHelperClass.ExecuteQuery]: Query 'CMS.Site.selectall' not found.
Ahhhh that was the tip I needed. I was using the wrong DLLs for my console app. Thank you!