Hi, sorry to bother you guys
I have spent a week on this problem and I guess I am just plain dumb.
Nothing I do seems to work.
1. What I am trying to do is open a simple form (newFormToSave.aspx)
2. load a dropdownlist (cboUpperFrontsStyleCode) with data
3. data comes from table (tblDoorStyles)
4. The field names are (DoorStyleId (nvarchar), DoorStyleName (nvarchar))
5. The database name is (JOHNS.styles.dbo)
I know that this is so trivial that nobody even goes through the steps.
I have bought books, went through code, checked out sites...
I am using VB.net 2003,
.net Framework 1.1,
asp.net 1.1
I have very little code and what little I have does not work
Public Class newFormToSave
Inherits System.Web.UI.Page
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
cboUpperFrontsStyleCode.DataSource = fungetDoorStyles()
End Sub
Private Function fungetDoorStyles() As OleDbDataReader
' get DataReader for rows from the door styles table (ID, name,
price group)
Dim sConnect As String _
= ConfigurationSettings.AppSettings("who knows what goes in here")
Dim sSelect As String _
= "SELECT DISTINCT DoorStyleID, DoorStyleName FROM tblDoorStyles "
Dim oConnect As New OleDbConnection(sConnect)
Try
oConnect.Open()
Dim oCommand As New OleDbCommand(sSelect, oConnect)
Return oCommand.ExecuteReader(CommandBehavior.CloseConnec tion)
Catch oErr As Exception
' be sure to close connection if error occurs
If oConnect.State <> ConnectionState.Closed Then
oConnect.Close()
End If
' display error message in page
lblErr.Text = oErr.Message
End Try
End Function
End Class