J
Jenden0
I'm new to C# (and Microsoft in general) so this may be a simple
problem, but I haven't been able to figure it out yet.
I've got a database with a number of different tables and I want the
user to be able to select which table they want, then have that table
pop up in a datagridview. I've figured out how to get it to work if I
specify the table adapter to use and do it all manually, but I'd like
to make a method that will populate the datagridview with data when it
is given the appropriate table name. As it is now the only way I can
get it to work it is having a giant switch statement. I'd like to go
for a much more elegant solution.
I'm using VS 2005 and right now all the database interfaces are
whatever VS auto-generated when adding a new binding source. All the
examples I've seen so far either involve specifying which data adapter
to use at compile time (giving me the big switch statement) or running
all my own SQL queries (which isn't really an ideal solution either).
problem, but I haven't been able to figure it out yet.
I've got a database with a number of different tables and I want the
user to be able to select which table they want, then have that table
pop up in a datagridview. I've figured out how to get it to work if I
specify the table adapter to use and do it all manually, but I'd like
to make a method that will populate the datagridview with data when it
is given the appropriate table name. As it is now the only way I can
get it to work it is having a giant switch statement. I'd like to go
for a much more elegant solution.
I'm using VS 2005 and right now all the database interfaces are
whatever VS auto-generated when adding a new binding source. All the
examples I've seen so far either involve specifying which data adapter
to use at compile time (giving me the big switch statement) or running
all my own SQL queries (which isn't really an ideal solution either).