N
needin4mation
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.
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.