my ASMX file
===========
<%@ WebService Class="BeerServiceDB" Language="C#" %>
using System;
using System.Web.Services;
using System.Data;
using System.Data.OleDb;
[WebService( Namespace="http://web2.bender.com/rkoch1/webservices" )]
public class BeerServiceDB : WebService
{
[WebMethod(Description="This method returns the 'Beer' catalog.")]
public DataSet processQuoteRequest() {
string strSelect = "Select ProductName, ProductDescription, UnitPrice, filepath From Beers;";
OleDbConnection myConnection = new OleDbConnection "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../Database/KochBeer.mdb");
OleDbCommand myCommand = new OleDbCommand(strSelect, myConnection);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myCommand);
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, "Beers");
return myDataSet;
}
}
Attempted ASPX file to read and send back a DataSet with the data.
=======================================================
<%@ Page Language="C#" %>
<script language="C#" runat=server>
void Page_Load(Object sender , EventArgs e) {
BeerServiceDB objBeers = new BeerServiceDB();
dgrdBeers.DataSource = objBeers.processQuoteRequest();
dgrdBeers.DataBind();
}
</Script>
<html>
<head><title>DisplayBeerCatalog.aspx</title></head>
<body>
<h2>Available Beers:</h2>
<asp:DataGrid ID="dgrdBeers" Runat="Server"/>
</body>
</html>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE