fill dropdown with database data?

liunx

Guest
I am trying to figure this out, but it is not working. BTW, I am using Dreamweaver. I need to fill a dopdownlist with data from Access. Can anyone help me? It is so much easier in VS.NET, but my friend needs it done in here. Please help! I can even cut you part of the check :)


<html>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
Dim connString as String
connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & _
"C:\Inetpub\wwwroot\2006DB.mdb;"

Dim strSQL as String = "SELECT GrpingCode FROM tbl_CourseMainInfo"
Dim da as New OleDataAdapter(strSQL,connString)
Dim ds as New DataSet()
da.Fill(ds,"tbl_OTOLupCourseGroups")
Dim row as Datarow
row = ds.Tables("tbl_CourseMainInfo").Rows()
For Each row in ds.Tables("tbl_CourseMainInfo")
select3.Items.Add(row("GrpingCode"))
Next
end sub
</script>

<table width="96%" cellpadding="1">
<tr valign="middle">
<td colspan="5"><font color="#333333" size="2" face="Geneva, Arial, Helvetica, sans-serif">Filter
by grouping code: </font> <font color="#333333" size="2" face="Geneva, Arial, Helvetica, sans-serif">
<select name="select3">
<option>Default</option>
</select>
</font><font color="#666666" size="2" face="Geneva, Arial, Helvetica, sans-serif">
</font></td>
</tr>
</table>
</html>So this is what I am trying to do right now, just to explain better. A friend sent me some .htm pages that he created in Dreamweaver. There are a few pages that have dropdownlists and he needs to fill them with data from Access. Do I just leave them as .htm pages or do I need to switch to .aspx? And how do I fill the dropdownlists? I know how to do it in Windows Applications, but Web Apps are newer to me, especially in Dreamweaver. Any help would be GREATLY appreciated. Thanks!i use the same thing you do but, as i understand it - when you get to that level, you have to refer to the indexes (zero based)
i use this same thing to add employee numbers, first name & last name.
so i have to loop thru that dataset and concatenate the three elements.


Below would loop thru and add the very first index item.

For Each dRow In ds.Tables(0).Rows
cboNotDone.Items.Add(dRow.Item(0))
Next


hopefully this would help
thanks
rik
 
Back
Top