UseFoldersInsteadOfHostnamesForMultipleSites error with sqlce db

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
12/14/2011 1:41:24 AM
Gravatar
Total Posts 46

UseFoldersInsteadOfHostnamesForMultipleSites error with sqlce db

Hi, joe

when <add key="UseFoldersInsteadOfHostnamesForMultipleSites" value="true"/> error occurs with sqlce db.

error in below code 

mojoPortal.Data.SqlCe\DBSiteSettings.cs

/////////////////////////////////////////////////////////////////////////////////////////////

public static int GetSiteIdByFolder(string folderName)
{
int siteId = -1;

StringBuilder sqlCommand = new StringBuilder();

SqlCeParameter[] arParams = new SqlCeParameter[1];

arParams[0] = new SqlCeParameter("@FolderName", SqlDbType.NVarChar, 255);
arParams[0].Direction = ParameterDirection.Input;
arParams[0].Value = folderName;

sqlCommand.Append("SELECT COALESCE(s.SiteID, -1) ");
sqlCommand.Append("FROM mp_SiteFolders sf ");
sqlCommand.Append("JOIN mp_Sites s ");
sqlCommand.Append("ON ");
sqlCommand.Append("sf.SiteGuid = s.SiteGuid ");
sqlCommand.Append("WHERE sf.FolderName = @FolderName ");
sqlCommand.Append("ORDER BY s.SiteID ");
sqlCommand.Append(";");

using (IDataReader reader = SqlHelper.ExecuteReader(
GetConnectionString(),
CommandType.Text,
sqlCommand.ToString(),
arParams))
{
if (reader.Read())
{
siteId = Convert.ToInt32(reader["SiteID"]);
}
}

......

////////////////////////////////////////////////////////////////////////////

above bold code error.

if change to 

siteId = Convert.ToInt32(reader[0]);

then will ok!

thanks!

version: 2.3.7.5

db: sqlce

os: windows 7

 

12/14/2011 7:00:49 AM
Gravatar
Total Posts 18439

Re: UseFoldersInsteadOfHostnamesForMultipleSites error with sqlce db

Hi,

Thanks for the bug report.

This fix is now in the source code repository so it will be fixed in the next release.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.