1. Create custom .aspx
page in sharepoint
2. Edit page with
sharepoint designer
3.Grab a SqlDataSource from the insert--> ASP.NET -->Data
ToolBox and set up your connection string like below:
<asp:SqlDataSource runat="server" ID="myOracleDBSource" ProviderName="System.Data.OracleClient" ConnectionString="Data
Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=[host
name])(PORT=[port number]))(CONNECT_DATA=(SERVICE_NAME=[service name])));User ID=[username];Password=[Password];Unicode=True" SelectCommand="SELECT * FROM [view name] ">
</asp:SqlDataSource>
4. Grab a GridView from the insert--> ASP.NET
-->Data ToolBox and then Set AutoGenerateColumns to False.
-
Add BoundField Columns in GridView and set the DataField and the HeaderText
accordingly. See below:
<asp:GridView runat="server" id="myOracleGridView" AutoGenerateColumns="False" DataSourceID="myOracleDBSource" AllowPaging="True">
<EmptyDataTemplate>No Records Found
!</EmptyDataTemplate>
<Columns>
<asp:boundfield DataField="column 1" HeaderText="column 1" SortExpression="column 1">
</asp:boundfield>
<asp:boundfield DataField="column 2" HeaderText="column 2" SortExpression="column 2">
</asp:boundfield>
</asp:GridView>
5. Compile and run your page to see the output
Column 1 | Column 2 |
Eve | Jackson |
John | Adisu |
No comments:
Post a Comment