473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

confused noob about ASP, DataSets, and DropDown Lists

I am trying to tie a column in a database to a dropdown list, but
having very little luck.
The table is bound to the .aspx page via oledbadapter1 and
oleconnection1, but when I try to create a dataset from it and use one
column of the table, it doesnt work. Either I get an error saying the
type is not a recordset, or it just wont fill the combobox. Please
Help

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
Dim DATechNo As OleDb.OleDbDataAdapter = New
OleDb.OleDbDataAdapter
Dim DSTechNo As Data.DataSet = New Data.DataSet
Dim dc As DataSet = CType(DDTechNo.DataSource, Data.DataSet)
Dim RS As String
RS = "SELECT * FROM TechNumber.TechNumber"
DDTechNo.DataSource(me.OleDbDataAdapter1.Fill(dc,1 ,,
TechNumber)
DDTechNo.DataBind(TechNumber)


OleDbConnection1.Close()
OleDbConnection1 = Nothing

The name of the Table and column are both TechNumber. In The Line
DDTechNo.DataSource(me oldedbdataadapter1.Fill(dc, 1, , TechNumber)
TechNumber is supposed to be the table I am using, but ASP.NET doesnt
recognize it.

This project is a conversion of an ACCESS 2003 database with forms to
an ASP.NET web based database using VB 2003.

Any help will be much appreciated.

Nov 9 '07 #1
1 1335

"Stephen D Cook" <st******@comcast.netwrote in message
news:pm********************************@4ax.com...
>I am trying to tie a column in a database to a dropdown list, but
having very little luck.
The table is bound to the .aspx page via oledbadapter1 and
oleconnection1, but when I try to create a dataset from it and use one
column of the table, it doesnt work. Either I get an error saying the
type is not a recordset, or it just wont fill the combobox. Please
Help

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
Dim DATechNo As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter
Dim DSTechNo As Data.DataSet = New Data.DataSet
Dim dc As DataSet = CType(DDTechNo.DataSource, Data.DataSet)
Dim RS As String
RS = "SELECT * FROM TechNumber.TechNumber"
DDTechNo.DataSource(me.OleDbDataAdapter1.Fill(dc,1 ,,TechNumber)
DDTechNo.DataBind(TechNumber)

that's a little hard to follow, but try this:

OleDbDataAdapter1.Fill(dc)
DDTechNo.DataSource = dc
DDTechNo.DataBind()

in place of the last two statements in your code ... but I don't see a
connection anywhere ... ?? so what is the adapter talking to and how?
where's the data?

if you rearrange your code a bit you can instantiate the DataAdapter as so:
Dim DATechNo As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(RS,
oConnection)

but of course you need oConnection first:

Dim oConnection as OleDbConnection = new
OleDbConnection(<connection_string>) 'YOU supply <connection_string>

:: you ought to work on those naming conventions a bit; this code is not
easy to read, and I'll bet it's not easy for you either
>
OleDbConnection1.Close()
OleDbConnection1 = Nothing

The name of the Table and column are both TechNumber. In The Line
DDTechNo.DataSource(me oldedbdataadapter1.Fill(dc, 1, , TechNumber)
TechNumber is supposed to be the table I am using, but ASP.NET doesnt
recognize it.

This project is a conversion of an ACCESS 2003 database with forms to
an ASP.NET web based database using VB 2003.

Any help will be much appreciated.

Nov 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Toonman | last post by:
I have a webpage with a <form> consisting of a large table grid of dropdown lists used to make changes in a database. Some of these dropdown lists have the same value. I'm trying to make it so...
0
by: Mike O. | last post by:
MS Access 2003 "filter by form" has drop down lists that allow the user to select values for each field to filter by. However, once some values are selected,the remaining dropdown lists remain the...
0
by: E . | last post by:
I seem to be getting nowhere with this problem here is the situation. I have a webform with a data grid populated with the results of a table that has only 3 fields. Then below that are 1...
4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
0
by: Henke | last post by:
Hi, I have done some research about my problem I have when using the "back button" in IE to go back to a page with two dropdown lists. The both dropdown lists are populated with data. The...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
4
by: Paul | last post by:
Hi all, I have a page that has a form on it which has a dropdown list on it. It connect to an sql database and populate the list. What I would like to do is make the list editable so that if the...
3
by: John | last post by:
I have two dropdown lists that I have bound to a datatable and set the DataTextField and DataValueField for. Both lists show the values I expect from the database. However, when I need to access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.