473,385 Members | 2,005 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,385 software developers and data experts.

basic MS Access Question.. get a data into a dataset

Hi,

Just learning how to use VB.net and Access databases. I am use to working
against a SQL server.

I have a Oledb connection to an access database. I have created a query in
the access database that I want to create a dataset in my vb app using the
query data.

I am able to get the query results into a reader, but I need it in a
dataset, as a thirdpart grid i am using requires a dataset (as it has a
iBindinglist)

my code for the datareader is :

dim dbConnection As New OleDbConnection
dbConnection.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data
Sou... ETC..)
dbConnection.Open()
dim command As New OleDbCommand("select * from projectcosts", dbConnection)

dim reader As OleDbDataReader = command.ExecuteReader()
what do i have to do to get my result into a dataset ?

Thanks
Feb 16 '08 #1
2 1285
On Sat, 16 Feb 2008 06:59:52 -0000, "Aussie Rules" <au****@nospam.com>
wrote:
>Hi,

Just learning how to use VB.net and Access databases. I am use to working
against a SQL server.

I have a Oledb connection to an access database. I have created a query in
the access database that I want to create a dataset in my vb app using the
query data.

I am able to get the query results into a reader, but I need it in a
dataset, as a thirdpart grid i am using requires a dataset (as it has a
iBindinglist)

my code for the datareader is :

dim dbConnection As New OleDbConnection
dbConnection.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data
Sou... ETC..)
dbConnection.Open()
dim command As New OleDbCommand("select * from projectcosts", dbConnection)

dim reader As OleDbDataReader = command.ExecuteReader()
what do i have to do to get my result into a dataset ?
Look at DataSet.Load()
Feb 16 '08 #2
Aussie Rules wrote:
Hi,

Just learning how to use VB.net and Access databases. I am use to
working against a SQL server.

I have a Oledb connection to an access database. I have created a
query in the access database that I want to create a dataset in my vb
app using the query data.

dim dbConnection As New OleDbConnection
dbConnection.ConnectionString =
("Provider=Microsoft.ACE.OLEDB.12.0;Data Sou... ETC..)
dbConnection.Open()
dim command As New OleDbCommand("select * from projectcosts",
dbConnection)
I would ditch the reader, and use an adapter, something like this:

Dim ds As New DataSet
Dim da As New OleDbDataAdapter(command)
da.Fill(ds)
Feb 16 '08 #3

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

Similar topics

6
by: Hamed | last post by:
Hello I have employed as a developer in a software company that its team uses FoxPro / VB 6.0 / VC++ 6.0 as the developing tools and newly is going to migrate to VS.NET. There is a project...
0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
1
by: David | last post by:
Hi everyone. I have read every page that Google returns on this topic, but can't find anything that resolves my problem. Basically, I have an Access Database that does a number of different...
5
by: jqpdev | last post by:
Hello all... I'm coming from a Borland Delphi background. Delphi has a specific component called a Data Module. In the designer the Data Module behaves like a windows form. A developer can...
3
by: DwC | last post by:
Hi, We have a ms access database that we will be using to develop a website which would have fairly low usage levels. We have some experience with windows apps but not so much with asp.net...
14
by: Steve | last post by:
Sorry in advance for my ignorance. Any help would sure be appreciated. I'm writing a fairly simple application with VB.Net and am obviously a bit of a newbie. This application will be used by 1,...
16
by: Mr. B | last post by:
VB.net 2003; MS Access db; Netframe 1.1 I wrote an Windows app for my last place of employment that opened and modified a couple of MS Access db files. I did most of my programming at home on...
6
by: JimmyKoolPantz | last post by:
I have been given the task of converting a program from VFP (visual foxpro) to Visual Basic.net. My question is "Is it possible to generate a DBF file Dynamically(at runtime) using Visual...
1
by: needin4mation | last post by:
If I have a legacy database that I cannot use the Drag and Drop dataset tools with Visual Studio, is the correct (only) way to get to the data using a DSN on the machine like so: DataSet ds =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.