?
Solved

Get schema and gridview problem

Posted on 2006-04-24
1
Medium Priority
?
515 Views
Last Modified: 2013-11-19
Hello experts,

I found the following article for getting a schema for an access database;-

http://aspalliance.com/542

I need to get the schema for a DB2 database, and I'm wondering if it will follow the same principle as the example in the link above. So I have done the following;-

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
private void Page_Load(object sender, EventArgs e)
{
System.Data.OleDb.OleDbConnection OleDbConnection1 =
new System.Data.OleDb.OleDbConnection("Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=XXX.XXX.XXX.XXX;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=MyUser;Password=MyPW";  
OleDbConnection1.Open();
System.Data.DataTable DataTable1 = OleDbConnection1.GetSchema();
OleDbConnection1.Close();
GridView1.DataSource = DataTable1;
GridView1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Database Schema</title>
</head>
<body>
      <form id="form1" runat="server">
      <div>
            <asp:gridview ID="GridView1" runat="server">
            </asp:gridview>  
      </div>
      </form>
</body>
</html>


So my question is twofold,
1. Will this work, if not, is there actually a method for getting an IBM DB2 database schema

2. I get the following error at the moment when I run the above code;-
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type System.Web.UI.WebControls.gridview from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

Source Error:
Line 22: <form id="form1" runat="server">
Line 23: <div>
Line 24: <asp:gridview ID="GridView1" runat="server">
Line 25: </asp:gridview>  
Line 26: </div>

Many Thanks.
0
Comment
Question by:claracruz
1 Comment
 
LVL 10

Accepted Solution

by:
SystemExpert earned 2000 total points
ID: 16533080
Hi,

very first statement
"Retrieving Access database schema with ASP.NET 2.0 is actually very simple."

It's in .net 2.0

and it shows the error for 1.0.5000.0

try for convert or something else

Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question