Public Class WebForm2
Inherits VSPage '<----- Inheruted from the VSPage Class
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
'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.
Dim myConnection As SqlConnection
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
myConnection = New SqlConnection(" DATABASE=Northwind;SERVER= localhost;UID=sa;PWD=password;")
If Not Page.IsPostBack Then BindGrid()
Private Sub BindGrid()
'Create a DataAdapter to fetch data from Products Table
Dim myCommand As SqlDataAdapter
myCommand = New SqlDataAdapter("select * from orders WHERE ORDERID < 10600", "DATABASE=Northwind;SERVER=localhost;UID=sa;PWD=;")
'Create a DataSet and Fills it with Product Data
Dim ds As New DataSet
DataGrid1.DataSource = ds.Tables(0)
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)