List Info

Thread: Database access without using a dataset




Database access without using a dataset
user name
2006-06-20 20:53:48
I need to access an ODBC database (Connx), running a single
query at a time.
I DO NOT want to set up or fill a dataset because of the
immense size of
this database.  How do I set up a database connection in
.Net 2.0 so I can
open a connection, run a query on the database, and close
the connection,
retrieving only the data I am querying for?  Every time I
try to use the
Data Source Wizard, it tries to set up a dataset.

Thanks,
Kelly

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Database access without using a dataset
user name
2006-06-20 21:09:58
what does your query look like? that is, what are you
getting back for results?

On 6/20/06, Kelly Baker <kbakerhoward-ind.com> wrote:
> I need to access an ODBC database (Connx), running a
single query at a time.
> I DO NOT want to set up or fill a dataset because of
the immense size of
> this database.  How do I set up a database connection
in .Net 2.0 so I can
> open a connection, run a query on the database, and
close the connection,
> retrieving only the data I am querying for?  Every time
I try to use the
> Data Source Wizard, it tries to set up a dataset.
>
> Thanks,
> Kelly
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

>


--
Thank You,

Kent Tegels
Database Curriculum Lead
Blog: http://staff.develop
.com/ktegels
DevelopMentor -- Advanced Training for Professional Software
Developers

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Database access without using a dataset
user name
2006-06-21 13:37:59
In code you can make a function which will take any SQL
select
statement and return just those records as a DataReader. 
Eg.

        dbCommand = dbConn.CreateCommand()
        dbCommand.CommandType = CommandType.Text
        dbCommand.CommandText = strSQL
        ReturnDataReader = dbCommand.ExecuteReader()

Or you could just return the column of interest.
This should work under all .Net frameworks.


On 6/20/06, Kelly Baker <kbakerhoward-ind.com> wrote:
> I need to access an ODBC database (Connx), running a
single query at a time.
> I DO NOT want to set up or fill a dataset because of
the immense size of
> this database.  How do I set up a database connection
in .Net 2.0 so I can
> open a connection, run a query on the database, and
close the connection,
> retrieving only the data I am querying for?  Every time
I try to use the
> Data Source Wizard, it tries to set up a dataset.
>
> Thanks,
> Kelly
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

>

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )