|
-
Feb 8th, 2002, 11:19 AM
#1
Thread Starter
Hyperactive Member
Drop Down Menu Filling
I'm just getting into ASP.NET and things were going okay till I try to fill a drop down menu.
I don't get any error but the drop down is filled with 'System.Data.Common.DbDataRecord' instead of what it should be.
I've followed the example in the book and it all looks okay, so I don't know why I get this error.
<%@ Control Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
Staff List: <asp ropDownList id="StaffList" runat="server" /><br />
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
Dim myConnection As SQLConnection
Dim myCommand As SQLCommand
Dim myReader As SQLDataReader
Dim sSQL As String
Dim ConnStr As String
sSQL="SELECT au_id, au_fname FROM authors ORDER BY au_fname"
ConnStr="Server=WEB_1;Uid=IntUser;Pwd=;DataBase=pubs;"
myConnection=New SQLConnection(ConnStr)
myConnection.Open
myCommand=New SQLCommand(sSQL, myConnection)
myReader=myCommand.ExecuteReader()
StaffList.DataSource=myReader
StaffList.DataBind()
myConnection.Close
End if
End Sub
</script>
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|