Solved

Sharepoint List Data Entry

Posted on 2009-05-14
7
414 Views
Last Modified: 2012-05-07
I would like to see an example of code which could be embedded in html that would enter data into a simple sharepoint list.  For example if the fields were: Title, Date, Comments.  Be aware that I don't have access to 2007 designer.  I would like to create a custom interface to enter data.  With a simple example I could see the methodology to create my own custom solution.
Thanks
0
Comment
Question by:bvanee1
  • 2
  • 2
  • 2
7 Comments
 
LVL 21

Accepted Solution

by:
66866 earned 250 total points
ID: 24395789
You'll have to use the Sharepoint Object Model. Create a reference to the Sharepoint DLL in your project.
In your code behind, create variables that create an instance of the Sharepoint site, web and list

dim spSite1 as new spsite("rootsite")
dim spweb1 as spweb=spsite.openweb("yoursubsite")
dim spyourlist as splist=spweb.lists("your list")
dim newitem as splistitem=spyourlist.add

add the item to your list using the code below
using spsite1
using spweb1
newitem("Title")=yourvalue
newitem("Date")=yourvalue
.
.
spweb1.AllowUnsafeupdates=true
newitem.update
spweb1.AllowUnsafeupdates=False

end using
end using

That's it !!
0
 

Author Comment

by:bvanee1
ID: 24398441
I might need some more help...still not getting it.  Let me give some more information.
URL to List: http://sharepointABC.com/fieldlocations/YYY/test/Lists/testlist/AllItems.aspx
The list contains one field: Title
I would like to add this code to a Content Editor Web Part with contans HTML.
Thanks
0
 
LVL 21

Expert Comment

by:66866
ID: 24398470
It's not possible to do this in Content Editor Web Part. You will have to create a custom webpart in Visual studio that can do this.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 24401377
Sharepoint Designer 2007 is now free and perfect for this.  Are you not allowed to use it?
0
 

Author Comment

by:bvanee1
ID: 24402093
Right, it is a government network and they have restricted access to designer.  Working on it though.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 24407035
It's not a dangerous product.  Only site owners or site designers are allowed to use it on Sharepoint.  So, as long as your Sharepoint permissions are configured properly it's not dangerous.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question