473,225 Members | 1,234 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

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 1603

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
2
by: Ram | last post by:
I have an issue with detailsview control bound to an objectdatasource. scenario is i have a business logic component with CRUD methods that accept custom business entity objects. In asp.net layer...
3
by: CWWong | last post by:
I am using DetailsView using ObjectDataSource with DataSourceTypeName assigned to the specific class. SelectMethod, UpdateMethod and DeleteMethod is working successfully, except InsertMethod. The...
1
by: ThomasNexoe | last post by:
Hi there, I quite new to posting in this forum. I have a problem which I truly hope someone can help me out. I have a master/detail page - with a gridview displaying company names, and a...
2
by: Damon | last post by:
Help! Need this fixed ASAP. I have a GridView/DetailsView master/details form set up, with both bound to separate ObjectDataSource objects. Both the GridView and the DetailsView have a...
1
by: J055 | last post by:
Hi I have a Business class called User which returns a DataRow for individual user accounts using accountID as a parameter (i.e. User.Retrieve(accountID)). The ObjectDataSource doesn't complain...
0
by: Syd_Man | last post by:
Hello guys, I have some wiered problem ...I have a header details form where the header part is a datagrid and the details part is a Detailsview control. Once I select a record in the header it...
1
by: JJ | last post by:
What's best practise in this situation: Upon submitting data input on a detailsview (bound to an objectdatasource), I need to check for a duplicate email address (in an sql database) and present...
0
by: Cirene | last post by:
Using Visual Studio I created a DataSet using the GUI (XSD file). Trying to use a tiered methodology I called the functions from my BLL. Namespace Zzz.BusinessLogicLayer #Region "DAL Access"...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.