Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Visual Studio Database question

$
0
0

Hey all

I've been on here before and I've gotten answers, but they didn't drive things home for me. I'm still confused. What I'd like to do is start over from scratch and work my way forward. I believe I started off too ambishous and I need to scale it back to basics and go from there.

My goal is to write a few different programs that use a database to store different information in a table or tables in a database. It could be a program for cataloging my library, for my recipies, etc... I know there are programs out there that do this all ready, but none with all the features I want, so I want to create my own.

I've taken several Visual Basic classes through high school and college, but I've forgotten a lot of it. I'm basically at the point where i vaugely remeber what can be done with it, but I need to do a little research to figure out how to get there.

Right now, I'm starting with a brand new program. I've just downloaded Visual Studio 2012 Express. I created a new project called 'Books'. I choose to add a windows form. I let it load and changed the form name and the text of it.

At this point I'm following a video on youtube by a guy called Tim Layton on creating a database in 10min. He has a slightly different set up than me, but I can follow along up to a point. He does what I've just done, but with a C# form. He then goes on to add a database. He right clicked the project name in pane on the right. He then went 'Add + New'. He chose data and then service based database. I'll ask a question on whether i should be using that or a local database later. So I created my database and named it BookDatabase or something like that, leaving the extension and hit next or finish or whatever the proceed button was. I got a pop-up window the same as he did wanting me to choose a data source or something, though his was empty and mine had dataset highlighted and another option. He clicked cancel, so I did as well.

This added a database in a pane on the left hand side. I followed along and right clicked on tables and choose to add a new table. I created a table that had author information in it as my trial table. I put AId as the primary key, he had to select his primary and mine was set to whatever I put in the first column. I also added ASur, AFirst, ASite as additional fields as nchar(50) fields.

This is where things went awry. The main problem was that he went to save his on his video and it asked him for a table name. He entered it and it disappeared. When I tried to save mine, it asked me to choose a location on my computer to save it. It seems to me that since I created a project and added a database, that it should be automatically created and storing the tables for me. It seems to be doing it for him. It also seems to have the default name set at dbo.Table.sql. I think that's what it is, but I'm at work and have it on my PC at home. I couldn't figure out how to change the name either. I tried in the table properties, but it was greyed out and while I could select it, I couldn't change it. I did something while playing around and finally got it changed, but I don't know what. I think I changed it down in the sql code window. I kept updating the table and database and it just randomly appeared. I'd like to know how to change the name properly. However, even with a name change, it still asked me to choose a location to save the table.

Can anyone help me with this issue. I apologize for being so lengthy, but I wanted to give background and in the future I plan to put shorter questions and just have links to my previous questions if someone needs to review. I'm trying to take this step by step till I understand what I'm doing. Thanks for the help and please keep it simple stupid since I am dumb about this right now. :))


Edit: Is it possible that in his version you do save the table, but that in mine it's automatically saved when you update the database and when you try to save it, it's saving a copy or something?

Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>