Error with ObjectDataSource and DetailsView - conversion error

G

Guest

Hi all,

I've created a new project to test ObjectDataSource component.

I've just added a new objectdatasource, configured it (linked to a table)
etc ...

It works fine on localhost, i can create, retrieve, update and delete data.



My problem occurs when I publish this sample on my production server.

I've created the same table (EXACTLY THE SAME), changed connection strings
and all I need.



When I run my page with the detailsview and the objectdatasource, I can see
all records in the database (connection to the database is OK). I can also
delete records.

When I try to create or update a new record, I receive the following error
(I cqn fill my fields but when I press insert or update the problem occurs):



Disallowed implicit conversion from data type sql_variant to data type
varchar, table 'hervdb.sokette.Video', column 'description'. Use the CONVERT
function to run this query.
Disallowed implicit conversion from data type sql_variant to data type
varchar, table 'hervdb.sokette.Video', column 'url'. Use the CONVERT function
to run this query.
Disallowed implicit conversion from data type sql_variant to data type
datetime, table 'hervdb.sokette.Video', column 'date'. Use the CONVERT
function to run this query.


A line for each field in fact.



My objectdatasource looks like this :



<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DeleteMethod="DeleteVideo"

InsertMethod="AddVideo" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetVideo"

TypeName="VideoBLL" UpdateMethod="UpdateVideo">

<DeleteParameters>

<asp:parameter Name="id" Type="Int32" />

<asp:parameter Name="original_id" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:parameter Name="description" Type="String" />

<asp:parameter Name="url" Type="String" />

<asp:parameter Name="date" Type="DateTime" />

<asp:parameter Name="original_id" Type="Int32" />

</UpdateParameters>

<InsertParameters>

<asp:parameter Name="description" Type="String" />

<asp:parameter Name="url" Type="String" />

<asp:parameter Name="date" Type="DateTime" />

</InsertParameters>

</asp:ObjectDataSource>



I've tried with a few differents tables, always the same problem :s

The problem probably occurs because I don'y use the same table in
production and test but I can't access production database during development.



Don't hesitate to ask more information,



Thanks,



Denis Sohet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top