E:\web\learnaspcom\htdocs\freebook\learn\ubtoc.xml LearnAsp.com - ASP ASP.net Free Lessons
Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll
<Asp.net blog>
<personal site>
xxx

Utility Belt: Xray Demo C#
by Charles Carroll

The code below calls "Utility Belt" functions.

The Array Manipulation Code is one demo of Array "Utility Belt" functionality including tracing of arrays and datatables.

   filename=/experiments/utilitybelt/vercurrent/ubdemo_xray_cs.aspx

<Test Script Below>


<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="LearnASP"%>
<%@ Assembly src="utilitybelt.vb" %>
<script language="C#" runat="server">
    UtilityBelt ub1=new UtilityBelt();
    string strConnect;
protected void Page_Load(object S, EventArgs E)
    {
    strConnect=@"\experiments\data\biblio.mdb";
    
    ub1.Options("Debug-on,Xray-to-Page-On,SuperTrace-on");
    

    DataTable dtNYFolks=new DataTable();
    ub1.DBPopulate(strConnect,"select * from publishers where state='NY'",dtNYFolks);
    ub1.Xray(dtNYFolks,"dtNYfolks");


    string[] arryCities=new string[1];
    ub1.DBPopulate(strConnect,"select distinct city from publishers",arryCities);
    ub1.Xray(arryCities,"arryCities");

    
    ub1.Array1dRandomize(ref arryCities,2);
    Trace.Warn("SUB Page_Load", "now we re-arranged the array");
    ub1.Xray(arryCities,"arryCities");

    Array arryNY=new string[1,1];
    ub1.DBPopulate(strConnect,"select * from publishers where state='NY'",arryNY);
    ub1.Xray(arryNY,"arryNY");
    
    DataSet dsSlippers;
    dsSlippers=ub1.XMLToDataSet("/experiments/data/animalslippers.xml");
    ub1.Xray(dsSlippers,"dsSlippers");
    }
</script>
<html><head>
<title>Xray Utility Belt Demo</title>
</head>
<body bgcolor="#FFFFFF">
<form runat="server">
</form>
</body></html>
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too. a $5 tip buys him lunch at McDonalds, a $20 tip buys his kid Hitoshi a new computer game, a $39 tip buys his daughter Michiko a few nice outfits. See our donor list.