It's been happening now for a number of version updates. I want to say this goes back to about version 2.66. When I do an database infer, all my previously working stored procedure calls which included a date now fail. I get the following message: cannot convert from 'System.DateTime' to 'string'
My database is SQL Server. The stored procedures haven't changed, meaning the parameters are set as DateTime. However the function calls generated by Radzen are now setting the parameter as a string. Why the change? Do I have to go into 50+ lines to change the datetime variable to a string? This is actually pretty urgent right now as I have to make changes to the application, but I don't want to have to wade in and make all these changes for something that was working perfectly fine previously.
We are not aware of such issue. Please send us your stored procedure definition to test it locally, in the meantime you can download and use the version of Radzen that works properly.
I've attached a script that builds out the tables required for the stored procedure GetVoidPayments. Let me know if you require more. I'll gladly provide it.
Here is what is currently being generated for that stored procedure, you can see that the 2 date fields are set as strings and that inside the function, those fields are being converted back to a DateTime object in the FromSqlRaw function
I'm unable to find version of Radzen that supported DateTime type for stored procedure parameters. I've tested several old versions including one of the last versions for 2021 and parameters where always strings. Can you point us when this worked according to your expectations? I've tested even last version for November 2021
Yep, I had a version saved that I had to previously roll back to. It was 2.66.0.
Looking at it I understand what changed. It wasn't the actually Radzen storedprocedure function that changed. It was how the parameter was sent. So here's what it looks like in 2.66.0
var recoDbGetVoidPaymentsResult = await RecoDb.GetVoidPayments(selectedProgram, $"{selectedStartDate}", $"{selectedReportDate}");
getDataList = recoDbGetVoidPaymentsResult;
And here's what it looks like now.
var recoDbGetVoidPaymentsResult = await RecoDb.GetVoidPayments(selectedProgram, selectedStartDate, selectedReportDate);
getDataList = recoDbGetVoidPaymentsResult;
Here's a screenshot of the storedprocedure being called through the Handler. It doesn't change between the 2 versions, however the way the call is created does.