Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1055
  • Last Modified:

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
0
ramuar1981
Asked:
ramuar1981
  • 3
  • 2
1 Solution
 
Rainer JeschorCommented:
Hi,

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
0
 
ramuar1981Author Commented:
Is it possible to directly accessing tables from oracle database for custom webpart in moss 2007
0
 
Rainer JeschorCommented:
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.
0
 
ramuar1981Author Commented:
That link is pretty good but i didnt understand clearly the connection string can you please describe.

string connectiostr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server)
                                  (PORT=1569))(CONNECT_DATA=(SERVICE_NAME=service)))
                                  ;user id=user;password=pass
0
 
Rainer JeschorCommented:
Hi,
I am not an Oracle guy, but this is normally the information which is in the TNSNames.ora. The connection string identifies the correct server, database and schema.
If you connect to Oracle e.g.through SQL Developer you will find all that information in your connection.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now