VB Express & SQL Server Express

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
 
Last edited:
PS you asked for a good tutorial on this stuff.. see DW2 in my sig, section Creating a Simple Data App
The other thing i noted from reading your posts; you dont seem 100% on with OO concepts and VB here is NOT going to help
I've noticed that it doesn't. I'm actually very up on OOP concepts, but I'm coming from a Delphi perspective, so VB really does mess things up for me because it is so high level it prevents a lot of the lower level tricks i use in delphi and C++ :D. In some ways the limitations in that regard make my experience with VB.Net very frustrating and it shows in my posts. :(

As for naming schemes, I always make my instances differently named than my types, to save in my own confusion.

Allowing this confusion between types and instances (or read another way, allowing the coder to Dim variables that have names the same as types, and keywords) is one of the most retarded things modern vb does and it should have been dumped years ago.
I quite agree.
 
Back
Top