ramuar1981
asked on
How to display the data from oracle database in gridview in custom webpart in sharepoint 2007
My requirement:
1.Need to get the data from oracle databse.
2.Display the data in grid view in custom webpart in moss 2007.
This is urgent requirement.Can anybody please help regd this
1.Need to get the data from oracle databse.
2.Display the data in grid view in custom webpart in moss 2007.
This is urgent requirement.Can anybody please help regd this
ASKER
Is it possible to directly accessing tables from oracle database for custom webpart in moss 2007
Hi,
what do you mean with directly accessing?
The link I provided in topic 2 has in its second half (the code behind) the necessary part.
Open a Oracle connection, run a query, fill the data adapter, create a dataset from the result and bind this to the grid view. Thats how data get into the grid view - regardless which connection / server / query is run.
what do you mean with directly accessing?
The link I provided in topic 2 has in its second half (the code behind) the necessary part.
Open a Oracle connection, run a query, fill the data adapter, create a dataset from the result and bind this to the grid view. Thats how data get into the grid view - regardless which connection / server / query is run.
ASKER
That link is pretty good but i didnt understand clearly the connection string can you please describe.
string connectiostr = "Data Source=(DESCRIPTION=(ADDRE SS=(PROTOC OL=tcp)(HO ST=server)
(PORT=1569))(CONNECT_DATA= (SERVICE_N AME=servic e)))
;user id=user;password=pass
string connectiostr = "Data Source=(DESCRIPTION=(ADDRE
(PORT=1569))(CONNECT_DATA=
;user id=user;password=pass
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
these two links should provide you with the basics:
1. Create a SharePoint 2007 Web Part
a. Use WSP Builder
http://www.michaelbowersox.com/2009/01/18/intro-to-wspbuilder/
http://wspbuilder.codeplex.com/
b. Basis web part development
http://www.codeproject.com/Articles/25019/Getting-started-with-SharePoint-2007-Web-Parts
2. Basic Code for the web part
http://sharepointjournals.wordpress.com/2011/05/31/displaying-data-from-oracle-using-visual-web-part/
Hints:
- You would have to add the gridview dynamically to the web part in the code behind (as there are no Visual Webparts in SharePoint 2007)
- You should think about extending the web part to have a property which will store the connection string
HTH
Rainer