Solved

Sharepoint List Data Entry

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

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

939 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

Need Help in Real-Time?

Connect with top rated Experts

2 Experts available now in Live!

Get 1:1 Help Now