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

Basic asp.net 2.0 question about the dataset

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 = new DataSet();
OdbcConnection conn = new
OdbcConnection("DSN=myDSN;uid=xxx;pwd=xxx");
OdbcDataAdapter myAdapter = new OdbcDataAdapter(sqlString,
conn);
myAdapter.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();

I remember doing this a lot in 1.x, but didn't know if this was still
the way to do it (is this above just wrong for 2.0). As I said, the
database is old, legacy, so I couldn't not use any of the drag and
drop. I could get the wizard to come up, but I could not do things
like use variables such as with Sql Server @myVar.

Incidentally, is this using of the dataset with Sql Server and VS using
a ".net provider" for the database? Is that the big deal with database
companies producing a ".net provider" with the database (like mysql or
oracle) so that one can develop just like they can with sql server -
visually?

Thank you for any help.

Oct 2 '06 #1
1 1213
<ne***********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
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 = new DataSet();
OdbcConnection conn = new
OdbcConnection("DSN=myDSN;uid=xxx;pwd=xxx");
OdbcDataAdapter myAdapter = new OdbcDataAdapter(sqlString,
conn);
myAdapter.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
There's certainly nothing wrong with your database access methodology,
assuming that ODBC is *really* your only connectivity option...
As I said, the database is old, legacy
What RDBMS is it, AAMOI...?
Incidentally, is this using of the dataset with Sql Server and VS using
a ".net provider" for the database? Is that the big deal with database
companies producing a ".net provider" with the database (like mysql or
oracle) so that one can develop just like they can with sql server -
visually?
A native .NET is designed to provide the most efficient means of
connectivity between the .NET Framework (ADO.NET, specifically) and the
RDBMS - most, but not all, also provide the visual tools. I never use these,
because I much prefer to use a DAL (Data Abstraction Layer).
Oct 2 '06 #2

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

Similar topics

11
by: fremenusul | last post by:
First let me say I am familar with programming, but not familiar with VB.net. I am loading an existing XML document with this procedure Dim xmlFile As String = "..\data\Products.xml" Dim...
1
by: jm | last post by:
I manually put a datagrid in on a form. I then added this code to an event to populate it: OdbcConnection conn = new OdbcConnection("DSN=CardBase"); sqlCardHolders = "SELECT * FROM...
8
by: Sam Collett | last post by:
Is there a basic guide on Xml document creation and editing (simpler than the MSDN docs). Say I want to create a file containing the following: <?xml version="1.0" encoding="utf-8"...
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,...
0
by: Aziz | last post by:
1. If I create a sorted DataView object from a DataSet table, how do I reference the sorted elements? (Say I want to output the CustomerName for the first row in the sorted DataView to a label or...
3
by: Miro | last post by:
Ok im a newbie to VB, and am having some trouble reading msdn help / or how it all links together. My books are either missing a step / or assume everything is set up correctly. I know about...
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...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
1
Lokean
by: Lokean | last post by:
Hi. I have a vb.net program that hits a database and returns a dataset which I use in a datagrid for display purposes. I also want to output the dataset to a crystal report. I have used the...
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: 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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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...

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.