Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm new to SharePoint and I'm working with web parts.

I have learned how to create a basic webpart and how to deploy it...but I don't have any ideas about how to create a web part that adds updates and deletes records from a database.

share|improve this question
add comment

2 Answers

Making a Web Part that adds, updates or deletes item from a database is just standard ASP.NET programming. For instance if you want to insert a record to a database then you probably would like to add a button to your Web Part that has a click-handler method in which you make the database operations.

share|improve this answer
    
Thanks for the reply, i create one web part and add db connection and try to bind DataGrid with Database table...but when i try to add the web part to my WSS i got error "Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." here is my code –  Anonymous Apr 19 '10 at 7:03
    
This is due to the fact that you are running your Web Part under minimal trust/in the local bin of the web app (I guess). You need to add custom CAS policies. Read AC's CAS policy article on MSDN for more info: msdn.microsoft.com/en-us/library/ee909485.aspx –  Wictor Wilen MCA MCM MVP Apr 19 '10 at 8:02
add comment

You can use SPGridView instead of ASP.NET GridView, and consider SharePoint to be just another database repository.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.