mattgroening
New Member
Sorry about this simple question. Trying to simply output data to the screen. I've taken some sample code from this site, and it complies fine, but there's no output. I'm not sure where to start. I'll post the code. It shouldn't be a bad code dump, but to be honest I don't know what parts relevant and what part isn't. <BR><BR><%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="Appointment.WebForm1"%><BR><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><BR><HTML><BR> <HEAD><BR> <title>WebForm1</title><BR> <% @Import Namespace="System.Data" %><BR> <% @Import Namespace="System.Data.SqlClient" %><BR> <script language="vb" runat="server"><BR> Sub Page_Load(sender as Object, e as EventArgs)<BR> BindData()<BR> End Sub<BR> <BR> <BR> Sub BindData()<BR> '1. Create a connection<BR> Dim myConnection as New SqlConnection("Provider=SQLOLEDB.1;Persist Security Info=True;User ID=XXwd=yy;Initial Catalog=Appointment;Data Source=servername")<BR><BR> '2. Create the command object, passing in the SQL string<BR> Const strSQL as String = "SELECT DEPARTMENTNAME,DEPARTMENTCODE, COUNT(*) AS WAITING " & _<BR> "FROM CALL_QUEUE, DEPARTMENT WHERE STATUS in ('W','B','T','U','R' ) " & _<BR> "AND DEPARTMENT = DEPARTMENTCODE GROUP BY DEPARTMENTNAME,DEPARTMENTCODE ORDER BY WAITING DESC"<BR> Dim myCommand as New SqlCommand(strSQL, myConnection)<BR><BR> '3. Create the DataAdapter<BR> Dim myDA as New SqlDataAdapter()<BR> myDA.SelectCommand = myCommand<BR><BR> '4. Populate the DataSet<BR> Dim myDS as New DataSet()<BR> myDA.Fill(myDS)<BR><BR> '5. Set the datagrid's datasource to the dataset and databind<BR> DataGrid1.DataSource = myDS<BR> DataGrid1.DataBind()<BR> <BR> End Sub<BR> </script><BR> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0"><BR> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0"><BR> <meta name="vs_defaultClientScript" content="JavaScript"><BR> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"><BR> </HEAD><BR> <body MS_POSITIONING="GridLayout"><BR> <form id="Form1" method="post" runat="server"><BR> <aspataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 20px; POSITION: absolute; TOP: 85px" runat="server" Width="696px" Font-Names="Arial" Font-Size="Smaller"><BR> <AlternatingItemStyle BackColor="LightSteelBlue"></AlternatingItemStyle><BR> <HeaderStyle Font-Bold="True" HorizontalAlign="Left" ForeColor="White" BackColor="SteelBlue"></HeaderStyle><BR> </aspataGrid><BR> </form><BR> </body><BR></HTML><BR>