B
Bijoy Naick
I am new to asp.net and having some trouble with a page.. First, here is
the code.. The script section goes in the head. The body contains the
datagrid line..
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E As EventArgs)
Dim myConnection as SqlConnection
Dim myCommand as SqlCommand
Dim myReader as SqlDataReader
Dim sql as String
Dim connStr as String
sql = "SELECT * FROM Shippers"
connStr="server=localhost;uid=dotNetUser;pwd=myPasswd;database=Northwind
"
myConnection = New SqlConnection(connStr)
myConnection.Open()
myCommand = New SqlCommand(sql, myConnection)
myReader = myCommand.ExecuteReader()
theList.DataSource = myReader
theList.DataBind()
End Sub
followed by
<aspataGrid ID="theList" runat="server"/>
My problem is that when the code executes, the datagrid is empty. There
are no error messages. I knwo for a fact that the Shippers table
contains a few records. The dotNetUser account exits in SQL Server and
has owner privs on the Northwind database..
What am i doing wrong?
the code.. The script section goes in the head. The body contains the
datagrid line..
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E As EventArgs)
Dim myConnection as SqlConnection
Dim myCommand as SqlCommand
Dim myReader as SqlDataReader
Dim sql as String
Dim connStr as String
sql = "SELECT * FROM Shippers"
connStr="server=localhost;uid=dotNetUser;pwd=myPasswd;database=Northwind
"
myConnection = New SqlConnection(connStr)
myConnection.Open()
myCommand = New SqlCommand(sql, myConnection)
myReader = myCommand.ExecuteReader()
theList.DataSource = myReader
theList.DataBind()
End Sub
followed by
<aspataGrid ID="theList" runat="server"/>
My problem is that when the code executes, the datagrid is empty. There
are no error messages. I knwo for a fact that the Shippers table
contains a few records. The dotNetUser account exits in SQL Server and
has owner privs on the Northwind database..
What am i doing wrong?