User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 392,269 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,724 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 3354 | Replies: 0
Reply
Join Date: Aug 2006
Location: Germany
Posts: 1
Reputation: bjoernscher is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bjoernscher bjoernscher is offline Offline
Newbie Poster

Help UpdateCommand does not work

  #1  
Aug 16th, 2006
First of all Hello to this forum. I have the follwoing problem.

When I am runnig an UpdateCommand with codebehind :
sqldatasource1.Update() I get the following error. (I want this command to CompareAllValues)

You have specified that your update command compares all values on SqlDataSource 'SqlDataSource1', but the dictionary passed in for oldValues is empty. Pass in a valid dictionary for update or change your mode to OverwriteChanges.

My Code looks like this :

<asp:SqlDataSource ID="SqlDataSource1" runat="server"            ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="" 
            ConflictDetection="CompareAllValues" 
            DeleteCommand="" 
            InsertCommand="" 
            UpdateCommand="UPDATE Hauptthema SET Categories = @Categories, Subject = @Subject, Body = @Body, filepath = @filepath 
FROM Hauptthema INNER JOIN Categories ON Hauptthema.Categories = Categories.CategoryID WHERE (Hauptthema.Categories = @original_Categories) 
AND (Hauptthema.ThreadID = @original_ThreadID) AND (Hauptthema.Body = @original_Body) AND (Hauptthema.Subject = @original_Subject) 
AND (Hauptthema.filepath = @original_filepath)"
            OnUpdated="OnUpdatedHandler">

 <UpdateParameters>
         <asp:Parameter Name="Categories" ConvertEmptyStringToNull="False" />
         <asp:Parameter Name="Subject" ConvertEmptyStringToNull="False" />
         <asp:Parameter Name="Body" ConvertEmptyStringToNull="False" />
         <asp:Parameter Name="filepath" ConvertEmptyStringToNull="False" />
         <asp:Parameter Name="original_ThreadID" />
         <asp:Parameter Name="original_Body" ConvertEmptyStringToNull="False" />
       <asp:Parameter Name="original_Subject" ConvertEmptyStringToNull="False" />
       <asp:Parameter Name="original_filepath" ConvertEmptyStringToNull="False" />
  </UpdateParameters>

Any suggestions to help me ?
I would like to keep "CompareAllValues" activated cause this database will be in use by many people.
Last edited by bjoernscher : Aug 16th, 2006 at 9:56 am.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 7:48 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC