One question I have is when saving DataType settings, in the example Tim saves to the DB like so with one setting
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",
SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId), SqlHelper.CreateParameter("@value", data));
But I want to have three settings on my DataType?
Looking at this example I'm thinking I would need to concat my three settings with a delimiter and save - Then split the string and sort the values out when I do my select statement?
Is this the right way to do it? Or am I missing the point completely?
I found a snippet where I saved multiple settings:
commandParameters = new SqlParameter[] { new SqlParameter("@value", this._parameter1.Text), new SqlParameter("@alias", "parameter1"), new SqlParameter("@dtdefid", this._datatype.DataTypeDefinitionId) }; SqlHelper.ExecuteNonQuery(GlobalSettings.DbDSN, CommandType.Text, "insert into cmsDataTypePrevalues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,2,@alias)", commandParameters); commandParameters = new SqlParameter[] { new SqlParameter("@value", this._parameter2.Text), new SqlParameter("@alias", "parameter2"), new SqlParameter("@dtdefid", this._datatype.DataTypeDefinitionId) }; SqlHelper.ExecuteNonQuery(GlobalSettings.DbDSN, CommandType.Text, "insert into cmsDataTypePrevalues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,2,@alias)", commandParameters);
Custom DataType Question
Hey all - Decided to have a go a creating a DataType, and I'm using Tim's great post as an example
http://www.nibble.be/?p=50
One question I have is when saving DataType settings, in the example Tim saves to the DB like so with one setting
But I want to have three settings on my DataType?
Looking at this example I'm thinking I would need to concat my three settings with a delimiter and save - Then split the string and sort the values out when I do my select statement?
Is this the right way to do it? Or am I missing the point completely?
Hi Lee,
I found a snippet where I saved multiple settings:
Hope this helps
/Jesper
Store the vlaues as xml?? Thats what I've done in my custom datatypes,
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.