<% @ Page language = "c #"%>
<% @ Import namespace = "system.data"%>
<% @ import namespace = "system.data.oledb"%>
Void Page_Load (Object Sender, Eventargs E)
{
OLEDBCONNECTION OBJCONNECTION;
OLEDBDataAdapter objcommand;
String strconnect;
String strcommand;
DataSet DataSet1 = New DataSet ();
StrConnect = @ "provider = microsoft.jet.Oledb.4.0;";
// if you don't have the grocertogo.mdb database, the you will have to
// Change the Following Three Lines to a Different Database
StrConnect = @ "Data Source = D: / ASPX / DB";
StrConnect = @ "/ grocertogo.mdb;";
StrConnect = "Persist security info = false";
STRCOMMAND = "SELECT ProductName, Unitprice from Products";
Objconnection = New OLEDBCONNECTION (STRCONNECT);
Objcommand = New OLEDBDataAdapter (strcommand, objconnection);
Objcommand.Fill (DataSet1, "Products");
DataGrid1.datasource = dataset1.tables ["products"]. Defaultview;
DataGrid1.databind ();
}
script>
hEAD>
body>
html>