Solved

Sharepoint List Data Entry

Posted on 2009-05-14
7
383 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 51

Expert Comment

by:tedbilly
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:tedbilly
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

13 Experts available now in Live!

Get 1:1 Help Now