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 have a table in database

I want to use a webpart to add, delete and udate data from database table

I can create a custom webpart with a gridview

but is there out of box webpart in 2007 sharepoint I can use ???

share|improve this question
add comment

3 Answers 3

I suggest you to use BDC (Business Data Catalog) in Sharepoint 2007. BCS is an upgraded version of BDC in Sharepoint 2010. So since you are using 2007, you should look for BDC.

You can use the BDC Web Parts to View, Update, Create, Delete items to the database.

Here is a tutorial to get you started:

http://zimmergren.net/technical/sharepoint-bdc-part-1-getting-started-with-the-business-data-catalog

share|improve this answer
add comment

what you are looking for is business connectivity services. now I am not sure if this existed with the same functionality in 2007.

http://pravahaminfo.blogspot.be/2011/06/business-connectivity-services-bcs-in.html

share|improve this answer
add comment

No not that i know of! any way that you chose you would need to create some code! there are alot of examples out there on the net!

For your issue it shouldnt be hard atall! just create three stored procedures for each task in SQL server, make sure you give each stored procedure the correct permission.

create your custome webpart and call the stored procedures from there!

somthing similar to this ;)

http://www.codeproject.com/Articles/33862/Connecting-to-Database-Using-Custom-Webpart-in-Sha

you can follow luis route:

Creating a Database Connection by Using the Business Data Catalog Definition Editor

http://msdn.microsoft.com/en-us/library/bb736296(v=office.12).aspx

EDIT

for sql commands

http://msdn.microsoft.com/en-GB/library/system.data.sqlclient.sqldataadapter.insertcommand.aspx

to add buttons to webpart:

in create child controls even add:

protected override void CreateChildControls()
{
   //create a new button object
   Button btngo = new Button();
   //give the button some text to show
   btngo.Text = "GO";
   //create the button click event
   btngo.Click +=new EventHandler(btngo_Click);

   //add button to control list to display
   this.Controls.Add(btngo);
}

//do what you want in the click event for the button
private void btngo_Click(object sender,EventArgs e)
{            
     //do what you want here on button click ;)       
}
share|improve this answer
    
thakn yours, but codeproject is not letting me add or delete to table in sql ??? –  Customized Name Apr 24 '13 at 11:39
    
thats beacsue they are using // SQL connection string. string sql = "select CustomerID,FirstName, LastName from SalesLT.Customer where FirstName like 'o%'"; –  ali Sharepoint Apr 24 '13 at 11:44
    
you need to add another two sql strings for adding and deleting ;) –  ali Sharepoint Apr 24 '13 at 11:44
    
for all the commands you need look here msdn.microsoft.com/en-GB/library/… –  ali Sharepoint Apr 24 '13 at 11:46
    
problem is not with commands sql therefore how i add buttons to webpart ???? –  Customized Name Apr 24 '13 at 11:48
show 1 more comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.