imports system data imports system data sqlclient imports
play

Imports System.Data Imports System.Data.SqlClient Imports - PowerPoint PPT Presentation

Imports System.Data Imports System.Data.SqlClient Imports MySql.Data.MySqlClient Imports System Imports System.Data.OleDb Public Class WebForm1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is


  1. Imports System.Data Imports System.Data.SqlClient Imports MySql.Data.MySqlClient Imports System Imports System.Data.OleDb Public Class WebForm1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent()

  2. End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myCon1 As New SqlConnection ("server=134.50.5.137;database=cis430sp05;user=iusr_cis430;password=microsoftisgood") Dim myCom1 As New SqlCommand("SELECT * FROM Products ORDER BY ProductID", myCon1) Dim myReader1 As SqlDataReader myCon1.Open () myReader1 = myCom1.ExecuteReader() While myReader1.Read() Response.Write(myReader1( "productID" ).ToString + "<br>") Response.Write(myReader1( "productName" ) + "<br>") Response.Write(myReader1( "productDesc" ) + "<br>" ) Response.Write("<img src='" + myReader1( "productpicurl" ) + "' /><br><br><br>" ) End While myCon1.Close() Response.Write( "<br>" ) Dim myCon2 As New MySqlConnection

  3. Dim myCom2 As New MySqlCommand Dim myReader2 As MySqlDataReader myCon2.ConnectionString = "server=134.50.5.137;database=cis430sp05;user id=iusr_cis430;password=opensourceisbad" myCom2.CommandText = "SELECT * FROM Products ORDER BY ProductID" myCom2.Connection = myCon2 myCon2.Open() myReader2 = myCom2.ExecuteReader() While myReader2.Read() Response.Write(myReader2( "productID" ).ToString + "<br>" ) Response.Write(myReader2( "productName" ) + "<br>" ) Response.Write(myReader2( "productDesc" ) + "<br>" ) Response.Write( "<img src='" + myReader2( "productpicurl" ) + "' /><br><br><br>" ) End While Response.Write( "<br>" ) myCon2.Close() myCon1.Dispose() myCon2.Dispose() End Sub End Class

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend