Solved

Sharepoint List Data Entry

Posted on 2009-05-14
7
407 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
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.

 
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

I recently came across an issue with a MOSS 2007 deployment where access into some sub-sites were denied, even for the MOSS farm administrators. A bit of background to the setup of this MOSS farm; this was a three server setup, consisting of a fr…
I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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