I have set up a mocro picker dataype and allowed it to use a macro called "brands".
The barnds macro contains to parameters, "imageID" (mediacurrent) and "link" (contentpicker)
When saving a page after choosing the parameters i get the following error:
Conversion failed when converting the nvarchar value
'<?UMBRACO_MACRO macroalias="Brands" imageID="1076" link="1064"
/>' to data type int.
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:
Conversion failed when converting the nvarchar value
'<?UMBRACO_MACRO macroalias="Brands" imageID="1076" link="1064"
/>' to data type int.
The error message is telling you that it can't store the macro string in the database datatype, which appears to be set as INT. You need to change it to NVARCHAR if possible...
If this doesn't answer your question, perhaps you could clarify - what do you mean by a Macro Picker Datatype? Do you mean the Macro Container datatype?
About the only thing I can suggest to "reset" the database datatype is try the following. It involved changing your datatype:
1. Change the Render Control to "Textbox" from the drop down and press save.
2. You should now be able to see a "Database datatype" field, and it's value is most likely currently set to "Int". Change that back to "Nvarchar" and save it again.
3. Now change the Render Control back to "Macro Container", press save and select the macro's you want to allow again.
There is another way you could fix this, but it involves editing the database directly. If you want to go down this route, let me know.
It was actually set to date. isnt it a bit strange that a type that is NOT selected has influence on a type that IS selected?!?! is this a bug or a feature?
yeah, I've noticed that sometimes the database datatype isn't what you expect. probably a bug in the Macro Container render control in that it doesn't set the datatype properly.
Error when using macro picker datatype
I have set up a mocro picker dataype and allowed it to use a macro called "brands".
The barnds macro contains to parameters, "imageID" (mediacurrent) and "link" (contentpicker)
When saving a page after choosing the parameters i get the following error:
Any ideas?
The error message is telling you that it can't store the macro string in the database datatype, which appears to be set as INT. You need to change it to NVARCHAR if possible...
If this doesn't answer your question, perhaps you could clarify - what do you mean by a Macro Picker Datatype? Do you mean the Macro Container datatype?
Im sorry. of course i mean the "macro container" datatype. Don't know where i got the "picker" from :)
I've looked through both the datatype settings and the macro settings, and i cant find anything that can be set as "int" or "nvarchar"...
are either "imageID" or "link" reserved by umbraco for something perhaps?!?! Could this it?
nope, it's nothing to do with that.
About the only thing I can suggest to "reset" the database datatype is try the following. It involved changing your datatype:
1. Change the Render Control to "Textbox" from the drop down and press save.
2. You should now be able to see a "Database datatype" field, and it's value is most likely currently set to "Int". Change that back to "Nvarchar" and save it again.
3. Now change the Render Control back to "Macro Container", press save and select the macro's you want to allow again.
There is another way you could fix this, but it involves editing the database directly. If you want to go down this route, let me know.
Hope this helps,
It worked, thanks
It was actually set to date. isnt it a bit strange that a type that is NOT selected has influence on a type that IS selected?!?! is this a bug or a feature?
yeah, I've noticed that sometimes the database datatype isn't what you expect. probably a bug in the Macro Container render control in that it doesn't set the datatype properly.
is working on a reply...