473,385 Members | 1,353 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,385 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 1610

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"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.