Results 1 to 1 of 1

Thread: Pure aspx code for IBM DB2 9.5

  1. #1
    Join Date
    Oct 2002
    Posts
    933

    Pure aspx code for IBM DB2 9.5

    If you are working with DotNet and the DB2 9.5 the following is the PureDB2 code that I use to test the installation. If you store a copy of the IBM.Data.DB2.dll in the /bin directory of your virtual site then you do not need to use the 'Assembly Name' declaration. If you prefer to store that in the GAC then use both lines. Adjust the parameters accordingly. Again, if you are using Tornado Gold, you do not have to struggle with the new DB2 applications, you just define the datatype and provider and your old code will work! A sample of Tornado cod eis included also for your reference.

    Sample aspx single file code -

    <%@ Assembly Name="IBM.Data.DB2, Culture=neutral,Version=9.0.0.2, PublicKeyToken=7c307b91aa13d208" %>
    <%@ Import Namespace="IBM.Data.DB2" %>
    <script language="VB" runat="server">
    Sub Page_Load(Src As Object, E As EventArgs)
    Dim strConn as string ="Server=localhost;Database=sample;UID=FRANK;PWD=p ass"
    Dim strSQL as string ="select * from employee"
    Dim Conn as New DB2Connection(strConn)
    Dim Cmd as New DB2Command(strSQL,Conn)
    Conn.Open()
    myDataGrid.DataSource = Cmd.ExecuteReader()
    myDataGrid.DataBind()
    End Sub
    </script>
    <html>
    <body>
    <ASPataGrid id="MyDataGrid" runat="server" />
    </body>
    </html>

    Sample Tornado Code -

    Dim x As New Tornado.z
    x.dbQP = "u=1|dt=DB2|pv=DB2Client|D=localhost;sample;frank; pass|th=tit=IBM DB2-9.5"
    x.dbSQL = "SELECT * from EMPLOYEE"
    x.ASPdbNET()



    Fk
    Last edited by Frank; 02-18-2008 at 12:44 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •