|
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
<%@ 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>
|