VS app does not show SQL or Access DB result in IE browser.

G

Guest

I just installed SQL 8.0, IIS, Visual Studio on XP Pro laptop. I installed
VS Books samples from book cd and ran SQL & Access DB samples on the browser
just fine.
Got the right results. I took the same code and created Visual Studio
project, making some changes until it was running and opening the browser
just fine - but my problem is I am not getting any DB table results - just a
blank browser. This happens for both SQL and Access only. All other apps
run just fine if no DB is involved. Please help with this problem. Do I
need to check on permissions on IE6 or VS.net??? I am new at this.
 
G

Guest

Sorry, this is a duplicate below. New at this.
The browser shows nothing at all. At first i was getting DBCOM errors and DB
cannot open because it may be opened by another user. Past those problems.
Thanks for looking at this.
Here is the code:
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="vb" CodeBehind="DisplayDataSetItems.aspx.vb"
AutoEventWireup="false" Inherits="tstwebapp.DisplayDataSetItems" %>
<HTML>
<HEAD>
<script language="VB" runat="server">
Sub Page_Load
Dim myDS As New DataSet()
Dim ConnStr As String
ConnStr =
"server=DCXK7X51\sqlapps;database=pubs;Trusted_Connection=yes"
Dim SQLSelect As String
SQLSelect = "SELECT * FROM Titles "
SQLSelect &= "SELECT * FROM Publishers"
Dim mySqlConn As New SqlConnection(ConnStr)
Dim mySqlDA As New SqlDataAdapter(SQLSelect, ConnStr)

mySqlDA.Fill(myDS)

' Get Each DataTable in the DataTableCollection and print each row
value.
Dim CurrentTable As DataTable
Dim CurrentRow As DataRow
Dim CurrentColumn As DataColumn
For Each CurrentTable In myDS.Tables
value.Text &= "Table: " & CurrentTable.TableName & "<br/>"
value.Text &= "---------------------------------<br/>"
For Each CurrentRow In CurrentTable.Rows
value.Text &= "<br/>&nbsp; "
For Each CurrentColumn in CurrentTable.Columns
If Not (CurrentRow(CurrentColumn) Is Nothing) Then
If Not IsDbNull(CurrentRow(CurrentColumn)) Then
value.Text &= CStr(CurrentRow(CurrentColumn))
Else
value.Text &= "NULL"
End If
value.Text &= "<br/>&nbsp; "
End If
Next
If CurrentRow.RowState = DataRowState.Unchanged Then
value.Text &= "Unchanged<br/>&nbsp; "
End If
Next
value.Text &= "---------------------------------<br/>"
value.Text &= "<br/><br/>"
Next
End Sub
</script>
</HEAD>
<body>
<asp:literal id="value" runat="server" />
</body>
</HTML>
 
G

Guest

Hi Biido,
Try declaring your Datable and Datarow before page_load
this 2 :-
Dim CurrentTable As DataTable
Dim CurrentRow As DataRow
GDLUCK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top