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: DataBinding Sample
by Charles Carroll

The code below shows "Utility Belt" simplifying the lines of code to DataBind a control.

Here is the way to bind a control with UtilityBelt. Note that strConnect can be a filename (in the case of Access, Excel or any file based database), a Key Name from Web.Config or any other legit connect string.

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

<Test Script Below>


<%@ debug="true" %>
<%@ Assembly src="utilitybelt.vb" %>
<%@ Import Namespace="LearnAsp.UtilityBelt"%>
<script language="VB" runat="server">
    dim strConnect as string="\experiments\data\biblio.mdb"
        dim ub1 as new learnasp.utilitybelt()
    dim strSQL as string
sub Page_Load(S As Object, E As EventArgs)
    ub1.Options("Debug-on")
    strSQL="select * from publishers where state='NY'"
    ub1.DBPopulate(strConnect,strSQL,grdSample)
End Sub
</script>
<html><head>
<title>Utility Belt Demo</title></head>
<body bgcolor="#FFFFFF"><form runat="server">
<asp:datagrid id="grdSample" EnableviewState="false" runat="server" />
</form></body></html>
Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site