Sinergia 0.6 problem with custom enumerations

20 views
Skip to first unread message

juraj

unread,
Nov 11, 2008, 2:49:07 AM11/11/08
to Sinergia Help Desk
Hi gents,

I have a problem with this new version. It works fine for me,
under 64bit Windows 2008 server and SQL express 2008, but when I want
to create new custom enumeration, with all required fields filled, it
gets me an error like

The parameterized query '(@Name nvarchar(4),@Description
nvarchar(4000),@DatasourceType i' expects the parameter
'@Description', which was not supplied.

Source Error:


Line 32: CustomEnumeration enumeration =
GetEnumerationFromControls();
Line 33: AdministrationManager manager = new
AdministrationManager();
Line 34: manager.CreateCustomEnumeration(enumeration);
Line 35: LoadEnumerationsListControl();
Line 36: CleanControlsContent();


Source File: c:\inetpub\wwwroot\Sinergia\Web\restricted\admin
\manageEnumerations.aspx.cs Line: 34

Stack Trace:


[SqlException (0x80131904): The parameterized query '(@Name
nvarchar(4),@Description nvarchar(4000),@DatasourceType i' expects the
parameter '@Description', which was not supplied.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection) +212

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +245
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj) +2811
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString) +2476380

System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async) +2478033
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result) +424

System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe) +522
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +182

Sinergia.DataAccess.AdminDataAccess.CreateCustomEnumeration(CustomEnumeration
data) in D:\Develop\net\Tiger\Sinergia\src\Projects\DataAccess
\AdminDataAccess.cs:100

Sinergia.Logic.AdministrationManager.CreateCustomEnumeration(CustomEnumeration
enumeration) in D:\Develop\net\Tiger\Sinergia\src\Projects\Logic
\AdministrationManager.cs:23
_Default.btnCreateType_Click(Object sender, EventArgs e) in c:
\inetpub\wwwroot\Sinergia\Web\restricted\admin
\manageEnumerations.aspx.cs:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+2981


It seems that sinergia required one field 'Description', but this
field is not provided in web interface for creating enumerations. In
previous version this feature works fine. Can anybody help me with
this?

thanx a lot

gabouy

unread,
Nov 11, 2008, 6:40:30 AM11/11/08
to sinergia-...@googlegroups.com
Hi juraj,

This is odd, it was an error I used to have, but fixed it. Are you running the latest sources? In the AdminDataAccess class, in the CreateCustomEnumeration method, if a description is not provided it should insert the empty string in the db. The command parameter is added in the following fashion,

mySqlCommand.Parameters.AddWithValue("@Description", data.Description ?? "");

Please check you have this line of code, in Sources/DataAccess/AdminDataAcess class CreateCustomEnumeration method, line 91 of the file.

regards,
gabo
--
http://blog.gabouy.com

juraj

unread,
Nov 11, 2008, 8:20:40 AM11/11/08
to Sinergia Help Desk
Hi gabo,

thanx for you reply. I'm using latest source downloaded with
new install package. I check mentioned class and there was a different
code in line 91:

mySqlCommand.Parameters.AddWithValue("@Description",
data.Description);

I updated it like you adviced and I get another error:

The parameterized query '(@CustomEnumerationId int,@Name
nvarchar(15),@Description nvarch' expects the parameter
'@Description', which was not supplied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The
parameterized query '(@CustomEnumerationId int,@Name
nvarchar(15),@Description nvarch' expects the parameter
'@Description', which was not supplied.

Source Error:


Line 139: int affected =
mySqlCommand.ExecuteNonQuery();
Line 140:
Line 141: if (affected != 1)
Line 142: {
Line 143: throw new SinergiaException("Problems
updating CustomEnumeration, affected rows != 1");


Source File: D:\Develop\net\Tiger\Sinergia\src\Projects\DataAccess
\AdminDataAccess.cs Line: 141

So do I need to update source code anywhere else?

regards
juraj

gabo

unread,
Nov 12, 2008, 1:20:45 PM11/12/08
to Sinergia Help Desk
Hi Juraj,

ok, I've got a different version of the sources then. I must have
fixed that after publishing the 0.6 version. As I told what I did to
fix it was load empty strings as parameters when they are null.
Nevertheless I expect to republish a new version by this weekend with
this particular fix.

regards,
gabo

juraj

unread,
Nov 13, 2008, 2:04:10 AM11/13/08
to Sinergia Help Desk
Hi Gabo,

yes, it seems that you are using a different sources version.
I'll wait for a new version and try it again.
Many thanks for your help

regards
Juraj

juraj

unread,
Nov 21, 2008, 8:12:22 AM11/21/08
to Sinergia Help Desk
Hi Gabo,

can you estimate when a new version will by published?

thanks
Juraj

gabouy

unread,
Nov 21, 2008, 9:00:13 AM11/21/08
to sinergia-...@googlegroups.com
Hi juraj,

I havent forgotten about you, but I'm loaded with work at the moment. If you prefer I can email you a zip with the latest sourcecodes.

regards,
gabo
--
http://weblogs.asp.net/gabriellopez/

juraj

unread,
Nov 21, 2008, 9:02:14 AM11/21/08
to Sinergia Help Desk
Hi Gabo,

if you will be so kind, please, send it via mail on
jur...@centrum.sk.

thanks
Juraj

On Nov 21, 3:00 pm, gabouy <g...@gabouy.com> wrote:
> Hi juraj,
>
Reply all
Reply to author
Forward
0 new messages