Problem with MySQL based installation

Dec 9, 2012 at 11:05 AM

Hi,

I want to use Nearforums with MySQL.

I read http://nearforums.codeplex.com/wikipage?title=Manual%20Install and made configuration. But I'm getting an error:

Parameter 'param_usergroupid' not found in the collection

[ArgumentException: Parameter 'param_usergroupid' not found in the collection.]
   MySql.Data.MySqlClient.MySqlParameterCollection.GetParameterFlexible(String parameterName, Boolean throwOnNotFound) +257
   MySql.Data.MySqlClient.StoredProcedure.GetAndFixParameter(String spName, DataRow param, Boolean realAsFloat, MySqlParameter returnParameter) +301
   MySql.Data.MySqlClient.StoredProcedure.CheckParameters(String spName) +359
   MySql.Data.MySqlClient.StoredProcedure.Resolve(Boolean preparing) +341
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1480
   MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +9
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +21
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +325
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +487
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +296
   NearForums.DataAccess.ForumsDataAccess.GetList(Nullable`1 role) +362
   NearForums.Web.Controllers.ForumsController.List() +52
   lambda_method(Closure , ControllerBase , Object[] ) +79
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +264
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.<>c__DisplayClass15.b__12() +124
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +726390
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +726390
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +309
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +726324
   System.Web.Mvc.Controller.ExecuteCore() +159
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +334
   System.Web.Mvc.<>c__DisplayClassb.b__5() +62
   System.Web.Mvc.Async.<>c__DisplayClass1.b__0() +15
   System.Web.Mvc.<>c__DisplayClasse.b__d() +52
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

I checked the stored procedure SPForumsGetByCategory in MySQL, it waits a parameter named param_usergroupid. But the SQL server version waits a parameter named UserGroupId (Different from MySQL version). And the code ForumsDataAccess.GetList is shown below:

var comm = GetCommand("SPForumsGetByCategory");
			comm.AddParameter(Factory, "UserGroupId", DbType.Int16, (short?)role);
			var dt = GetTable(comm);

As you see, it supplies a parameter named UserGroupId, not param_usergroupid.

 

Is this a bug or what can I do?

Coordinator
Dec 9, 2012 at 2:51 PM
Edited Dec 9, 2012 at 2:51 PM

Hi!

It might be an issue with the initialization pf the parameter prefix in the configuration...

Try setting up the parameter prefix to "param_".

 

Could you confirm me that changing the parameter prefix configuration helped?

Kind Regards,

Jorge

Dec 9, 2012 at 5:05 PM

Thanks for reply. I did it before write here but it did not worked :)

But I found the solution. I added globalization to web.config:

<globalization uiCulture="en-US" culture="en-US" />

And it worked. I realized that it's all about the "I" char. Lower case of "I" in English is "i" but in Turkish it's "ı" (i without dot). In my computer, default culture is tr-TR, so it does not works since lower case of UserGroupId is not usergoupid in Turkish :(.

I solved the problem. Thanks a lot.