|
-
Oct 6th, 2003, 02:10 AM
#1
Thread Starter
Addicted Member
Wrong heading - multiple datasets - also forgot to post cod
I am in teach myself mode for VB.NET after many years of vb3-6. I am writing a Web Project and I am confused about why I can't loop around the same command and datareader to fill number of listboxes. I have to close the command and the dataset and dim as differnet defintiions. There is probably something terribly wrong with what I'm doing. The connection can stay open but nothing elseand the the connection can stay open. I know I'm appearing like a newbie but I am when it comes to this.
Can anyone help ??
thanks BH
code below
Sub LoadLookups()
Dim cn As New OleDb.OleDbConnection(dbcConnection)
cn.Open()
'Descriptions
Dim cmd As New OleDb.OleDbCommand("Select Description FROM LUPropDesc ORDER by ID", cn)
Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader
cboPropType.DataSource = dr
cboPropType.DataTextField = "Description"
cboPropType.DataBind()
cboPropType.SelectedIndex = 1
dr.Close()
'Listing Types
Dim cmd1 As New OleDb.OleDbCommand("Select Description FROM LUListType ORDER by ID", cn)
Dim dr1 As OleDb.OleDbDataReader = cmd1.ExecuteReader
cboListType.DataSource = dr1
cboListType.DataTextField = "Description"
cboListType.DataBind()
cboListType.SelectedIndex = 4
dr.Close()
cn.Close()
End Sub
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
|