Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a request form that users can request books from one author or many authors. When there is one author, the update works. When there are many authors or genres the update does not work.

The update happens with an objectdatasource like this on the .aspx page like this:
C#
<asp:ObjectDataSource runat="server" ID="odsAuthorsDoc" SelectMethod="GetAuthorsDocByID" TypeName="Library.Media.AuthorDoc" UpdateMethod="UpdateAuthorsDoc">
        <SelectParameters>
            <asp:QueryStringParameter Name="RequestID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:QueryStringParameter Name="AuthorDocID" Type="Int32" QueryStringField="id" />
            <asp:ProfileParameter Name="Editor" PropertyName="RequestD" Type="Int32" />
        </UpdateParameters>

This is how the .cs page looks:

C#
   public static void UpdateauthorDoc(Int32 authorDocID, Int32 Editor, DateTime RequestDate, DateTime PickupTime, String Author, String Genre)
{
                  authorDoc old = authorDoc.GetauthorDocByID(authorDocID);
                  if (old.RequestDate != StartDate) requestItem.UpdateField(authorDocID, Editor, "RequestDate", RequestDate.ToShortDateString());
                  if (old.PickupTime != Duration) requestItem.UpdateField(authorDocID, Editor, "PickupTime", PickupTime.ToString());
                  if (old.Author != Author) requestItem.UpdateField(authorDocID, Editor, "Author", Author);
                  if (old.Genre != Genre) requestItem.UpdateField(authorDocID, Editor, "Genre", Genre);
}


How do I modify the code on the .cs page so I can update a string of authors names into the SQL XML field?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900