.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

SPListItem.Update fails inside a TransactionScope

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :SharePoint
 

I've added a CodeActivity to a Sequential Workflow, and placed it inside a TransactionScope activity.

In my code activity I am calling the Update() method on an SPListItem. When that line hits I get the following error:

Unable to cast COM object of type 'Microsoft.SharePoint.Library.SPRequestInternalClass' to interface type 'Microsoft.SharePoint.Library.ISPRequest'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{BDEADF28-C265-11D0-BCED-00A0C90AB50F}' failed due to the following error: Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)).

Does anyone have any idea why this is happening?


regards
Martin Hatch
MCPD .Net Web Development
MCTS WSS 3.0 | MOSS 2007
Visit my Blog - www.martinhatch.com


View Complete Post


More Related Resource Links

binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

  
i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

Why does reporting services always fails to update dataset rows?

  
Greetings I am working on a project, i must provide reports via Reporting Services. 2008. Problem is, it is for some reason almost always falsely declaring my query as a bad one (must declare something that IS declared, or wrong use of operator minus when its NOT wrong).  For example, i have a query with parameters @sd and @ed (start date and end date). I intend to let user set @ed to null, in that case, the month of @sd is used. So, first lines of query look like this: IF (@ED IS NULL) BEGIN SET @sd=DATEADD(dd,1-(DAY(@sd)),@sd); SET @ed=DATEADD(dd,-(DAY(DATEADD(mm,1,@sd))),DATEADD(mm,1,@sd)); END   And then it fails to see that @sd is a parameter, instead it spits like 5 times "must declare @sd" and refuses to refresh list of rows. Same happens with other queries. For example, i keep getting the "Operand data type nvarchar is invalid for minus operator" on a 100% correct query. And with others. Those are 100% legit, work in sql management studio as well as they work after i click "continue" at error message and compile a report.   So far this seems like a major bug to me. Or am i doing something wrong?

Update Gridvew Row inside popup extender control

  
I have a gridview with popup control extender to show details of the row, it works ok. But I also need to update the fields inside this popup window. How do I get the row ID and pass it to the button click event handler? Please help. 

User Control with JQuery doesnot work inside update panel

  

Hi All,

I created a .NET user control to work as a DropdownCheckbox and added Jquery to give the sliding and hide effects. The code is as below:

 <script language="javascript" type="text/javascript">
        var showRegionWindow = function (ev) {
            var pos = $("#lnkChangeRegion").offset();
            var width = 230;
            var height = 55;
            //$("#changeRegionPanel").css({ "left": +((pos.left) - 215) + "px", "top": height + 16 + "px" });.
            document.getElementById("lnkChangeRegion").style.display = 'none';
            $("#changeRegionPanel").slideDown();
        }

        var hideRegionWindow = function (ev) {
            var textVal = "";
   &nbs

try to reinstall .NET 4, error I need to install WIC, that fails with error update.exe not valid

  

trying to do a clean install of .NET v4, installation starts then stops with a fatal error.  I look at the log file, this is where it hangs up:

 

Action start 13:48:30: CA_Block_WIC_NotPresent_x86.
MSI (s) (68:60) [13:48:30:593]: Product: Microsoft .NET Framework 4 Client Profile -- You must install the 32-bit Windows Imaging Component (WIC) before you run Setup. Please visit http://go.microsoft.com/fwlink/?LinkId=162643&clcid=0x409 to install WIC, and then rerun Setup.

You must install the 32-bit Windows Imaging Component (WIC) before you run Setup. Please visit http://go.microsoft.com/fwlink/?LinkId=162643&clcid=0x409 to install WIC, and then rerun Setup.
Action ended 13:48:30: CA_Block_WIC_NotPresent_x86. Return value 3.


So I follow the link in the log file, when trying to install WIC I get the "update\update.exe is not a valid Win32 Application".

I can not find any info on how to fix this. 

thanks for any asisstance.

SQL Server Maintenance Plan - Update Statistics fails if schema contains special chars

  

We have a database schema with a period in it's name.  This is valid as per http://msdn.microsoft.com/en-us/library/aa224033(SQL.80).aspx. When we create a maintenance plan to update statistics it will succeed if the object property is set to 'Tables and Views'. If this is set to 'Table' it will fail.

Steps to Reproduce

  • Create a new schema in a user database with a period in it's name, ie
    CREATE SCHEMA [Windows.EventLog] AUTHORIZATION [dbo]
  • Create a table with owner using schema created in #1, ie
    CREATE TABLE [Windows.EventLog].[Computer](
    
    	[ComputerId] [smallint] IDENTITY(1,1) NOT NULL,
    
    	[ComputerName] [varchar](255) NOT NULL,
    
     CONSTRAINT [PK_Computer] PRIMARY KEY CLUSTERED ([ComputerId] ASC)
    
    ) ON [PRIMARY]
    
    
  • Create a new maintenance plan, drag 'Update Statistics Task' to designer surface, edit properites, choose the user database, View T-SQL and test execution: it will work
  • Edit maintenance plan and modify 'Update Statistics Task', change Object to Table, change selection to all, execute task and it will fail. Also, if you now try to click 'View T-SQL' or change it back to 'Tables and Views', a error dialog with title 'Microsoft.SqlServer.MaintenancePlanTasksUI' shows will message 'Object

Random error during update splistitem

  

Sometimes I get an error message when I update a splistitem:

Microsoft.SharePoint.SPException: Cannot complete this action. Contact your administrator. ---> System.Runtime.InteropServices.COMException (0x81070518): Cannot complete this action. Contact your administrator.
   at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish)
   at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bC

page inside update panel doesn't refresh the session object after postback of any control

  

Hi,

I have many controls like dropdown, radiobuttonlist, etc on my page and I put all these controls inside the update panel so that the page doesn't look to be posting back when something is selected. Now the working on the page is very smooth. But the session object isn't getting refreshed even if I postback to the server and as a result even if the users are working on the page they are being sent to the login screen after 20 mins.

Is there anyway where I could put all the controls in update panel and still refresh the session after any postback(dropdown selection)

Any help is greatly appreciated.

Thanks in advance


Can SharePoint field control have update panel inside a rendering template?

  

I am creating a custom field control with the following rendering template

<

 

SharePoint:RenderingTemplate Id="TestFieldRendering" runat="server">

 

vista trying to install .net framework 3.5 sp1 and family update and it fails

  
i am going through windows update after i reformatted my computer with my recovery discs and when i try to install KB951847, which is the .NET framework 3.5 sp1 and the family update, it always fails giving me error code 80073715.  when i try to install other things it needs the .NET framework client profile and that always fails also.  i have tried uninstalling all of the .NET i have on my computer and installing them from scratch but nothing helps that one install

How do I set the Interval for a Timer control which is inside a Update control?

  

Hi all,

Basically I am trying to execute this code:

        <ContentTemplate>      
        
         <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Enabled="True" Interval=Convert.ToInt32(ViewState["RefreshInterval"] />  
...

ERROR:

Error 1 Cannot create an object of type 'System.Int32' from its string representation 'Convert.ToInt32(ViewState["RefreshInterval"])' for the 'Interval' property.

Thank you



 


SPListItem Update() does not work from list.Items collection.

  

Hi All,

Not working code:

using System;
using Microsoft.SharePoint;

namespace ConsoleApplication3

{
class Program
{ 
static<

problem with greybox inside update panel

  

Hi ,

i am using an link which displays the window in a grey box

<script type="text/javascript"> var GB_ROOT_DIR = "<%= ConfigurationSettings.AppSettings["SunTrust.SOS.BaseURL"] %><%= ConfigurationSettings.AppSettings["Root_Dir_Lightbox"] %>";

<script>script type="tex

SPListItem.CopyTo method fails when copying to some sub-sites, but not others

  

Hi,

 

A custom workflow has been developed that copies pages from a top-level site to sub-sites. The pages are copied into a specific folder within the Pages Library of the sub-sites.

 

This workflow has been installed in 3 site collections and it works without any problems in 2 of these. In the third site collection, we achieve mixed results where the pages are copied successfully to some sub-sites, but not to others.

 

An exception is raised a few levels deep within the SPListItem.CopyTo metho

SPListItem.CopyTo method fails when copying to some sub-sites, but not others

  

Hi,

 

A custom workflow has been developed that copies pages from a top-level site to sub-sites. The pages are copied into a specific folder within the Pages Library of the sub-sites.

 

This workflow has been installed in 3 site collections and it works without any problems in 2 of these. In the third site collection, we achieve mixed results where the pages are copied successfully to some sub-sites, but not to others.

 

An exception is raised a few levels deep within the SPListItem.CopyTo metho

Radio buttons, a label and an image button show twice inside update panel

  

I have an update panel with a set of 2 radio buttons, a label and an image button inside of it. There another set of 3 radio buttons that trigger the update panel. I got everything working but now the image button, label and set of 2 radio buttons inside the update panel show up twice when the radio button triggers are selected? Any ideas?


Windows Update error message 84B30001 - SQL Server 2008 SP2 update fails

  

I am running Windows 7 Professional on a 64 bit platform and have Windows update on and selected to notify me when updates are available.  The other day, I received an error message that an update failed to install properly.  The update that failed is to update SQL Server 2008 SP2 - KB 2285068.  I have made several attempts to retry this update with the same result.  When I Googled the error message, all of the responses deal with the SQL Server 2008 SP1 update not SP2.  Couldn't find a solution to this problem - nor could I find one in the KB article - which basically explains details of SP2 and DOES give me the option to instal SP2 from here.  Don't want to take the chance and download it from here - maybe I should though.  Can usually find a solution to a Windows update error in Google - can't find one this time.

Any suggestions?


Jim Cutrara

Jim Cutrara
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend