Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-22-2005, 09:31 AM   #1 (permalink)
brendalisalowe
Registered User
 
Join Date: May 2005
Posts: 9
brendalisalowe is on a distinguished road
Why won't fill combobox?

Hello. I am trying to do this but I am new at this. I am using Dreamweaver and I know that is not the best for Dynamic stuff...I've heard. I'm more use to VS.NET. Anyway, just wondering why this is not filling my combobox? I'm newer to Access too. I usually use SQL Server. Anyway, I just need a little help on getting started. Thanks for your time!

Code:
<%@ 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 SqlDataAdapter(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")
		cmbSelect.Items.Add(row("GrpingCode"))
	Next
  end sub
</script>
<html>
..............
</html>
brendalisalowe is offline   Reply With Quote
Old 07-12-2005, 11:26 AM   #2 (permalink)
rdove
Masked Moderator
 
rdove's Avatar
 
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
rdove is on a distinguished road
You can't use the SQLDataAdapter for access databases, it is specific to SQL Server only. You need to use the OLEDBDataAdapter for that.
__________________
~Ryan

rdove is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 04:03 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting