Tornado API Library - V12.30.08

z.ASPdbNET Method (String)

An alternative form of ASPdbNET to include system options.

[Visual Basic]
Overloads Public Sub ASPdbNET( _
   ByVal MainParams As String _
)
[C#]
public void ASPdbNET(
   string MainParams
);

Parameters

MainParams
"New=True | NoTitle=True| Q=Quick Table| D=Quick DSN| Ajax=True"

Example


This example illustrates the SQL changes upon re-entrance when a 'New=True' condition is set.

Dim x As New Tornado.z
x.ASPdbNET("D=NWIND|Q=Orders|Ajax=t")
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim Emp As String = "Nancy,Andrew,Janet,Margret,Steven,Micheal,Robert,Laura,Anne"
Dim ID, Box6, Condition As String
Dim GD As New AsposeDb.GetData()
Dim LastUnit As String = GD.Get_Unit
Dim M1 As New ASPdbNet.z()
'... Create SBox
 With M1
  .dbQP = "U=6| M=ty=SBox!SboxMacro=({{1,2,3,4,5,6,7,8,9}}~{{" & Emp & "}})"
  .dbTextHolder = "Title=Select an Employee"
  .ASPdbNet()
 End With
'... if Sbox is clicked then save the screen for inactive display
 Condition = "" '... PostBack
    If LastUnit = "6" Or Session("Box6") = "" Then
     Session("Box6") = "%3cCenter%3e" & GD.Get_Sbox(6) & "%3c/center%3e"
     Session("ID") = GD.Get_SelectBoxSelection(6)
'...Force New Entry - SQL changed - this is not the same as New=True in dbCommonTable
     Condition = "New=True" 
    End If
'... display active or inactive Sbox
 Response.Write(Session("Box6"))
 Dim EmpArr As String() = Split(Emp, ",")
 Dim M2 As New ASPdbNet.z()
 With M2
'... build SQL and drop list according to selected value
  .dbQP = "U=7| M=Grid| ps=5| D=NWIND| ni=b5,add| gdf=0,1,2,3,7|Bm=orders;0|" & _
    "Q=Select * FROM Orders where EmployeeID = " & Session("ID")
  .dbEditAddFlds = "fi=EmployeeID|Ty=ROADD|Def=" & Session("ID") & "," & _ 
    "fi=CustomerID|ty=SelectBox|val=cusID"
  .dbCommonTables = "i=cusID|sql=SELECT CustomerID FROM Orders " & _
    "where EmployeeID = " & Session("ID") & "; " & _
    "ind=empID,empName| sql=SELECT employeeid, lastname FROM Employees"
  .dbLookUpFlds = "fi=employeeid|key=empID|Look=empName"
  .ASPdbNet(Condition)
 End With
End Sub
</script>
The Follwoing example maps the ASP-db code in to a Table control (table1) created with has 2 rows/cells - (0,0; 1,0). We'll put the Tornado title in the top cell and the Tornado Grid + Nav in the lower cell.
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
  Dim z As New Tornado.z
  Dim GD As New Tornado.GetData
  z.dbQP = "U=88| D=NWIND| Q=Orders| GDF=0,1,2,3| S=2| iv=t| Th=ti=Web Control Demo!sub=Hello"
  z.ASPdbNET("notitle=true")
  Table1.Rows(0).Cells(0).Text = GD.Get_Title(88)
  Table1.Rows(1).Cells(0).Text = GD.Get_ASPDBNET(88)
End Sub
</script>
The Code-Behind of the Table Web control will look like the following -
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm4.aspx.vb" Inherits="xapsx.WebForm4"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
   <title>WebForm4</title>
   <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
   <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
   <meta content="JavaScript" name="vs_defaultClientScript">
   <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
   <form id="Form1" method="post" runat="server">
      <asp:Table id="Table1" style="Z-INDEX: 101; LEFT: 112px; POSITION: absolute; TOP: 56px" runat="server"
         width="561px" height="424px">
         <asp:TableRow VerticalAlign="Middle">
            <asp:TableCell></asp:TableCell>
         </asp:TableRow>
         <asp:TableRow>
            <asp:TableCell></asp:TableCell>
         </asp:TableRow>
      </asp:Table>
    </form>
</body>
</HTML>
This example peform a quick open with navigation, search and memo detection.
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
  Dim x As New Tornado.z
  x.ASPdbNET("Q=employees|D=Nwind")
End Sub
</script>

See Also

z Class | Tornado Namespace | z.ASPdbNET Overload List | Get_ASPDBNET | Get_Title