470,594 Members | 1,429 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Error with ObjectDataSource and DetailsView - conversion error

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

Mar 28 '07 #1
0 1504

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ram | last post: by
1 post views Thread by JJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.