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


Top 5 Contributors of the Month
david stephan
Post New Web Links

Why List Item Attachments are read only?

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :SharePoint
 
I am programatically adding files to list item attachments. But when I open the file, and try to hit save, they throw a read only dialog box. int FileLength = File1.PostedFile.ContentLength; if (File1.PostedFile != null && File1.HasFile) { Stream fStream = File1.PostedFile.InputStream; byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length); fStream.Close(); fStream.Dispose(); myWeb.AllowUnsafeUpdates = true; SPAttachmentCollection attachments = enquiry.Attachments; attachments.Add(fileName, contents); enquiry.Update(); myWeb.AllowUnsafeUpdates = false; } What could I have missed?


View Complete Post


More Related Resource Links

Error creating Read Item or Read List operation in Sharepoint Designer 2010

  
In terms of high-level requirements, I need to pull in lists from a couple of different web apps.  To do this, I’m using SPD 2010 to create an External Content Type for the list of interest.  I’m able to create a SOAP Service or WCF Service connection just fine.  However, when I try to create the external content type and create a Read Item Operation on one of the GetList or any other Get* (or other Update methods for that matter) methods, I get the following error:"The method that your operation is based on has parameters with complex types that do not have default parameterless constructor.  This kind of data source methods cannot be used in Business Data Catalog."I tried defining an operation on the “AddAttachment” method, and that worked just fine.  I also tried providing default values to the listName and viewName parameters when creating the SOAP Service connection, but still get the error.  Same issue with a WCF Service connection as well. Does anyone know if this is a 2010 issue, or am I approaching this requirement incorrectly?  What are other approaches for connecting to lists that reside in a different web app than yours? 

Column to show count of attachments uploaded for each List item in MOSS 2007

  

We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

How to read a NULL value sharepoint list item

  

hi guys,

im having trouble pulling some specific information out from sharepoint list item. im doing a asp.net form and saved all user inputs into sharepoint list. if all information are there, my code works fine, if some colume is missing(the scenera requires to do that), it will return a  System.NullReferenceException: Object reference not set to an instance of an object exception. How can i read a null item, and maybe simply assign it to a string such as "NO VALUE", something like that?

i've tried all methods that i can think about, such as system.DBNull.value, or string.empty, or just null.

code is here: this is the save to list code:

private void SaveToTTCVIPList(SPWeb web)
    {
      try
      {
        TTCVIPList = web.Lists["TTCVIP"];
      }
      catch
      {
        TTCVIPList = AddList(web, "TTCVIP", "List for TTCVIP user's information", "Custom List", true);
        buildTTCVIPList(TTCVIPList);
      }
      SPListItem item = TTCVIPList.Items.Add();      
      ...      
if (this.txtJointHolderName.Text == System.DBNull.Value)
      {
        item["Joint Holder Name"] = string.Empty;

problem...i want a list item to populate all data in gridview!!!

  

i have a dropdownbox and a gridview

what I want is to have a list item which populates all data in a gridview.

I have tried using list item selected value=0 but to no avail.

what is the easiest way to achieve this?


Attach Workflow to Task List, don't get option to manually start workflow via dropdown on task item

  
Hi,

 

I am running WSS 3.0 with other workflows which are functioning correctly.  I created a new workflow in Visual Studio 2008 and was able to successfully run it in my dev environment.  I attached the workflow to a task list in my dev environment and was able to manually start the workflow by using the drop down workflow option and using the menus to manually start it.  I installed this workflow in our production environment and attached it to the task list (which had a SPD workflow attached to it which stopped working about a month ago).  I made sure that the option to manually start the workflow was checked.  When I tried to manually start the workflow, (hover mouse over title, drop down) there isn’t a workflow option.  The workflow also will not start automatically when a task is changed.

 

I attached this same workflow to a different task list in production and get the option to start it.

 

I have tried creating a small workflow in SPD 2007 and attaching it to the task list.  It shows that it is attached, when I look at the workflows that are attached to the task list, but I still don’t get the option to manually start it.

 

I have checked my security and I have fu

Workflow Task And Relevant List Item

  

Hello there...

1. What is the name of  the field thats connect between the task item and  the list name or guid and the list item id or guid

2. SPD: how can when starting the workflow how can i ensure that the initial form variables will be saved at the workflow task list

Many Thanks

ZahiS

 


Assigning users when creating a list item in a workflow

  

I'm using a workflow to assign tasks to users.  When I try to assign the task to a group (set in the workflow designer), the workflow gives me an error.  When I change the assign to property to a single user, the workflow works perfectly.  How do I get the workflow to assign the task to the group?  Or if that's not possible, can I get it to assign it to more than one user?

Kenn


KPI to calculate list item clicked most ?

  

Hello All:


Is there anyway where we can use KPI list to attach to a SharePoint list and indicates which item was clicked the most ? Or any other way to find out the best 5 links based on how many times they were accessed by a user?

 

Thanks in advance


SharePoint Developer

Concurrent update in sharepoint list item

  

Hi,

How the concurrent for sharepoint list item are are handled.

if two or more users are working on same item. Then how sharepoint process multiple update request for particular list item.


link from one list item to another item in the same list?

  

I have a list in which it is possible for one item to be related to another list item in the same list.  I am trying make a column in the list which would contain a hyperlink to the related list item.  The primary column is called Bill Number, and the secondary column is Companion Bill Number .  The Companion Bill Number is the one I want to be a hyperlink to the list time in which that number is the primary Bill Number.  (hope that made sense!). 

I thought I could create a hypertext link out of the Companion Bill Number dynamically in a workflow action that runs on item creation.  I tried this by using the string builder to create a string for the hypertext link that I set to a workflow variable.  It looks like this  <a href="listURL.aspx?ID=[%Bill:CompanionBill%]">[%Bill:CompanionBill%].  Then in another action in the same workflow I tried to set the CompanionBill column to the variable value. 

What I ended up with was, instead of the number as a hyperlink, the text in the column reads as [%Bill:CompanionBill%].  I'm thinking this is failing because of the workflow process doesn't have the value of CompanionBill at the time I am asking it to set the variable value.

Any ideas on how I might make this dynamic link creation work?


When editing a list item the fields are not blank.

  

This is a recent issue that I have in which I have a "Issue Tracking" List that maintains the workflow of contract renewals.

When an person goes to edit an existing list entry, the description field (standard) has the original text in the box. Prior to this the original - or any older text from a prior change was listed outside and just below the box - and non editable.

That's not the case anylonger.

Any thoughts?

Regards

Andy


Video: Field and List Item Validation in SharePoint 2010

  
SharePoint supports the ability to create Excel-like field validation formulas to validate field data in a list, which greatly reduces the amount of custom code that a developer must create and deploy. (Length: 1:44)

How to Set a list item's createdby or modifiedby field as a User(deleted from AD)

  

Hi,

I have to migrate data from SQL DB to SP list. But its old data and some users who created/modified the record has been deleted from the AD. Now I need to set the CreatedBy / ModifiedBy Field of the item accordingly. How to achieve this?

And when I tried to modify the "Editor" and "Author" field through Object Model, it works. But its not working through Webservice. What is the reason behind this?

Please help me find an optimal solution for this...

 

Thanks and Regards,

/* John JB */


c# form problem with list item

  

I've got a c# form containing a listbox how ever i cant get

listbox1.items.Selected      to work

nor

listbox1.items.SelectedValue


neither work. both not giving me the option for .selected nor selectedvalue

how does this work on c# forms as it works the above way on webforms....



How to read a column of a sharepoint list to a text string field of infopath form?

  
My infopath form used to read these email addresses from a web service and web.config file. Now i would like to get these user email addresses from a contact list in a sharepoint server. I am trying to do this without writing any codes. Here is what i have done so far: 1. Adding a new "data connection to receive data from SharePoint library or List" where i selected Email Address column of the contact list. 2. I added a new Text Field and define a new rule with "Query using a data connection" defined above. When i try to access the newly created Text field above it always return empty as if the Query attached to it did not executed at all. What did i do wrong? Is there a better way? Thank you in advance for your help.

Update SharePoint List item using UpdateListItem web service with javascript

  
I'm using the Custom_AddListMenuItems function in a CEWP to add a menu item to each list item to Archive that item. This is achieved by updating a choice field in the item to 'Archived'. I'm trying to do this using the web service UpdateListItem web service to update the item using Javascript, but I can not find the correct code that updates the list item. I'm using this code:     var ctx=currentCtx;     var ciid=currentItemID;     var xmlHttp=null;     if (confirm("Are you sure you want to Archive this item?"))     {         var soapRequest = '<?xml version="1.0" encoding="utf-8"?>'+             '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'+             '    <soap:Body>'+             '        <UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">'+         

radiobutton list item make visible true or false in javascript

  
in my project i have used one radiobuttonlist according different user login , i want to make one of radiobuttonlist item visible true or false..   please help me to solve this issue.   thanks in advance.  
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