Hi , i want to ask that how can we insert list item in share point existing list using CAML and SPQuery.Query in server object model , is their any way to write query to insert and update it i have read and delete the item using this but i can't find any means to do add and update .. the code is :
SPWeb mySite = SPContext.Current.Web;
SPList li = mySite.Lists["List"];
SPQuery oQuery = new SPQuery();
oQuery.Query = string.Concat("<Where><Eq>",
"<FieldRef Name='ID'/>",
"<Value Type='Number'>", TextBox7.Text.ToString() ,"</Value>",
"</Eq></Where>");
oQuery.ViewFields = string.Concat(
"<FieldRef Name='ID'/>",
"<FieldRef Name='Title'/>",
"<FieldRef Name='Email'/>",
"<FieldRef Name='Department'/>");
oQuery.ViewFieldsOnly = true;
SPListItemCollection collListItems = li.GetItems(oQuery);
int j = collListItems.Count;
for (int i = 0; i < j; i++)
{
collListItems[0].Delete();
cc.Text = "Deleted";
}
Also , i have found this while searching for the solution
<Batch OnError="Continue">
<Method ID="1" Cmd="New">
<Field Name="WikiField">My Wiki Content</Field>
</Method>
</Batch>
please assist me with your solutions and ideas ?