S
student
Hello all, could someone explain why I'm getting a blank web page when I run
start my code in a web browser? Here is the code:
Imports System.Data.SqlClient
Imports System.Data
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
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()
End Sub
#End Region
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
'Create the data connection.
Dim sqlconnectContactMgmt As New SqlConnection _
("server=(local);database=Contacts;Trusted_Connection=yes")
'Create a data adapter.
Dim sqladaptContactMgmt As New _
SqlDataAdapter("select * from Contacts", sqlconnectContactMgmt)
'Create a data set.
Dim dsContacts As New DataSet()
'Fill in the data set.
sqladaptContactMgmt.Fill(dsContacts, "Contacts")
'Display the table in a data grid using data binding.
Dim DataGrid1 As New DataGrid()
DataGrid1.DataSource = dsContacts.Tables("Contacts").DefaultView
DataGrid1.DataBind()
End Sub
End Class
start my code in a web browser? Here is the code:
Imports System.Data.SqlClient
Imports System.Data
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
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()
End Sub
#End Region
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
'Create the data connection.
Dim sqlconnectContactMgmt As New SqlConnection _
("server=(local);database=Contacts;Trusted_Connection=yes")
'Create a data adapter.
Dim sqladaptContactMgmt As New _
SqlDataAdapter("select * from Contacts", sqlconnectContactMgmt)
'Create a data set.
Dim dsContacts As New DataSet()
'Fill in the data set.
sqladaptContactMgmt.Fill(dsContacts, "Contacts")
'Display the table in a data grid using data binding.
Dim DataGrid1 As New DataGrid()
DataGrid1.DataSource = dsContacts.Tables("Contacts").DefaultView
DataGrid1.DataBind()
End Sub
End Class