JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
Okay,
I'm trying to do something very simple here, which is create a small database to be used by my application. I installed SQl Server Express and VB Express, and proceeded to create a database. First I added a DataSource, (and created the sdf file through that process) and then with the Database Explorer I created several tables, and the relationships between them, which I then drag/dropped onto a the dataset designer. (.xsd file).
Now, I want to use them, and I haven't a clue how, so I don't expect anyone to answer everything, but perhaps a point in the right direction for a good tutorial.
There are BindingSources, TableAdapters, the Dataset (typed or untyped) and a whole slew more of stuff that seems way more complicated than necessary.
My First desire:
A list box with all the table names, and a DataGridView(). When i click on the table name I want the DataGridView to list the contents of that table. So far, it doesn't work at all. When I set the datagridview's data source to my dataset and set the datamember to a table it seems to work, in design mode, but in run mode I can't change the DataMember type to tell the datagrid to refresh with a new datasource table.
letting the system do it for me, auto-created a TableAdapter for the specific Table beind used as the DataMember and a BindingSource specific to that table as well. But I can't change the DataMember of the Binding Source either so again that didn't work.
Do I need to have 45 different objects for all the different tables in my DataSet just to get the DataGridView to read them, or can I set the input at run-time?
Secondly, (on the same form) i have a text box and I want to be able to write and run SQL on the dataset, involving all the tables within, but I can't even begin to find how to Execute a SQL statement on the data set so I'll need a point in that direction.
Basically, I know Databases quite well, and I know VB.Net decently, but How to connect the two together?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
I'm trying to do something very simple here, which is create a small database to be used by my application. I installed SQl Server Express and VB Express, and proceeded to create a database. First I added a DataSource, (and created the sdf file through that process) and then with the Database Explorer I created several tables, and the relationships between them, which I then drag/dropped onto a the dataset designer. (.xsd file).
Now, I want to use them, and I haven't a clue how, so I don't expect anyone to answer everything, but perhaps a point in the right direction for a good tutorial.
There are BindingSources, TableAdapters, the Dataset (typed or untyped) and a whole slew more of stuff that seems way more complicated than necessary.
My First desire:
A list box with all the table names, and a DataGridView(). When i click on the table name I want the DataGridView to list the contents of that table. So far, it doesn't work at all. When I set the datagridview's data source to my dataset and set the datamember to a table it seems to work, in design mode, but in run mode I can't change the DataMember type to tell the datagrid to refresh with a new datasource table.
letting the system do it for me, auto-created a TableAdapter for the specific Table beind used as the DataMember and a BindingSource specific to that table as well. But I can't change the DataMember of the Binding Source either so again that didn't work.
Do I need to have 45 different objects for all the different tables in my DataSet just to get the DataGridView to read them, or can I set the input at run-time?
Secondly, (on the same form) i have a text box and I want to be able to write and run SQL on the dataset, involving all the tables within, but I can't even begin to find how to Execute a SQL statement on the data set so I'll need a point in that direction.
Basically, I know Databases quite well, and I know VB.Net decently, but How to connect the two together?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
Last edited: