sql Diagrams!!

pachjo

Well-known member
Joined
Dec 12, 2006
Messages
370
Programming Experience
10+
So I decide to start right from the beginning to learn the correct way to use SQL Database in VB.NET and am following the link to :

'Walkthrough: Creating a SQL Server Express Database File'

I got to the step:

'Right-click the Database Diagrams node in the SampleDatabase.mdf node in Server Explorer/Database Explorer and choose Add New Diagram.'

But I do not have permission to impersonate dbo user.

I have read and searched on how I do this and found that I need to be a member of the db_owner role.

OK, but how do I do that? I have searched and searched but nothing?

Even the section that deals with Diagrams does not tell me how, it just tells me I need to do it?

I dont understand why the walkthough I am 'walking through' does not cover this?

Please can someone point me to where I can find out how to achieve this?

Thanks
 
If youre after the way to use a database in .NET, i'm a bit puzzled as to why youre creating a database; dont you already have one you can use?

MS provide the Northwind sample databases and use them in their walkthroughs in the DW2 link.. If youre stuck for a database,you could do worse than use the sample ones, because at least the walkthroughs are text-perfect to what you will see in screen; when it says "put a tick next to the orders table" you will be able to do just that
 
I was just trying to follow the tutorial?

Also I found that even on my existing app that has a database I created in VS.NET I still could not use the Database Diagram option?

But when At work today on the network I can?

I read about this last night and connected to VPN but this did not help whislt at home.

What I am concerned with now is this....

At what point do I start to learn the right way? I tried from the beginning and got stuffed on the database diagram?

It is this reason I choose to use books as I have one place to work thru. When on the web you get redirected to link to link to link and eventually I get totally lost and depressed :(
 
I was just trying to follow the tutorial?

Also I found that even on my existing app that has a database I created in VS.NET I still could not use the Database Diagram option?

What is a database diagram? I've never heard of this. What tutorial are you following?


At what point do I start to learn the right way? I tried from the beginning and got stuffed on the database diagram?
I'm at a loss when it comes to this database diagram thing - i've never used anything called that. Are you sure youre calling it the correct name?

Take a look at the DDS link in my signature. Is that what you mean when you say "Database Diagram" ? (The DataSet Designer Surface)

When on the web you get redirected to link to link to link and eventually I get totally lost and depressed :(
Makes me think more on a comment made by another member - "if [cjard] had a training video, [the member] would watch it"
 
Erm.. How?

That page lists about 25 - 30 walkthroughs.. did you just pick one at random?

Read the "Simple app" one. If you cant see it Ctrl+F for "SIMPLE"..

No mention of creating a SQLS DB..
 
:confused:

I'm using SQL Express so clicked on ...


How?? How can you possibly get this wrong?
The DW2 link points directly to a list of pertinent walkthroughs, one of which is "Walkthrough: Creating a Simple Data Application"
That's the link i wanted you to read.

Why would you then do the following:

Click DW2
Not read the DW2 article list to find the link you were supposed to read
Go into the tree-menu on the left
Collapse the "Getting started with Data Access" menu node
Expand the "Connecting to Data in Visual Studio" menu node
Click on the "Walkthrough: Connecting to Data in a SQL Server Express Database" node
Read 10% of the article
Click on the "Walkthrough: Creating a SQL Server Express Database File" link
Get stuck with it



Please, tell me how you can possibly perform this set of steps that noone told you to do, when all you had to do was click one link, either read or use Ctrl+F to find the relevant link, then take your hand off the mouse and read..

Note that when you encounter text such as:
To create the project
  1. From the File menu, create a new project.
  2. Select Windows Application and name it DataWalkthrough. For more information, see Creating Windows-based Applications.
  3. Click OK.
    The DataWalkthrough project is created and added to Solution Explorer.
You dont *have* to read the "For more information see Creating Windows-based Applications" link. Creating a new empty project isnt rocket science. Dont divert into the first link you come across. If a link decribes something that absolutely really is blocking your progress then read it. Stuff like "if you dont have the northwind sample database installed, see here"
Yes, read that article. Install that Northwind database, but stick with the main article youre following.. The Simple App one..


For the avoidance of any doubt. Here is the actual article I wanted you to read (DW2, Simple App link) with the slight problem that the inline links dont work (all the <a href= javascript guff> - if you want those to work, see the main article on Microsoft.com (In the DW2 link, Simple App article):
Data Access in Client and Middle-Tier Programming
Walkthrough: Creating a Simple Data Application

One of the most common scenarios in application development is to display data from a database on a Windows Form. You can display data on forms in Windows applications by dragging items from the Data Sources Window onto your form. This walkthrough demonstrates how to create an application that displays data from two related tables in a database.
ms171884.note(en-US,VS.80).gif
Note The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

Tasks illustrated in this walkthrough include:
  • Creating a Windows application.
  • Creating and configuring a dataset in your application based on the Customers and Orders tables in the Northwind database using the Data Source Configuration Wizard.
  • Adding controls to display data from the Customers table.
  • Adding controls to display the Orders based on the selected Customer.
  • Testing the application, selecting different customers and verifying that the correct orders are shown for the selected customer.
var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl101c9b3b9,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl10img,";Prerequisites
In order to complete this walkthrough, you will need:
  • Access to the Northwind sample database. To setup sample databases, see <A onclick="javascript:Track('ctl00_LibFrame_ctl10|ctl00_LibFrame_ctl11',this);" href="http://msdn2.microsoft.com/en-us/library/8b6y4c7s(VS.80).aspx">How to: Install Sample Databases.

var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl12258c4a3,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl12img,";Creating the Project
The first step is to create a Windows Application project.
To create the project
  1. From the File menu, create a new project.
  2. Select Windows Application and name it DataWalkthrough. For more information, see <A onclick="javascript:Track('ctl00_LibFrame_ctl12|ctl00_LibFrame_ctl13',this);" href="http://msdn2.microsoft.com/en-us/library/54xbah2z(VS.80).aspx">Creating Windows-based Applications.
  3. Click OK.
    The DataWalkthrough project is created and added to Solution Explorer.


var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl14b4d596f,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl14img,";Creating the Data Source
This step creates a dataset based on the Customers and Orders tables in the Northwind sample database.
To create the data source
  1. On the Data menu, click Show Data Sources.
  2. In the Data Sources window, click Add New Data Source to start the Data Source Configuration Wizard.
  3. Select Database on the Choose a Data Source Type page, and then click Next.
  4. On the Choose your Data Connection page do one of the following:
    • If a data connection to the Northwind sample database is available in the drop-down list, select it.
      -or-
    • Select New Connection to launch the Add/Modify Connection dialog box. For more information, see <A onclick="javascript:Track('ctl00_LibFrame_ctl14|ctl00_LibFrame_ctl15',this);" href="http://msdn2.microsoft.com/en-us/library/c3t1z354(VS.80).aspx">Add/Modify Connection Dialog Box (General).
  5. If your database requires a password, select the option to include sensitive data, and then click Next.
  6. Click Next on the Save connection string to the Application Configuration file page.
  7. Expand the Tables node on the Choose your Database Objects page.
  8. Select the Customers and Orders tables, and then click Finish.
    The NorthwindDataSet is added to your project and the Customers and Orders tables appear in the Data Sources window.


var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl1687e1035,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl16img,";Creating Controls to Display Data from the Customers Table
To create controls to display the customer data (parent records)
  1. In the Data Sources window, select the Customers table, and then click the drop-down arrow.
  2. Select Details from the Customer table's control list.
  3. Drag the main Customers node from the Data Sources window onto Form1.
    Data-bound controls with descriptive labels appear on the form, along with a tool strip (<A onclick="javascript:Track('ctl00_LibFrame_ctl16|ctl00_LibFrame_ctl17',this);" href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingnavigator(VS.80).aspx">BindingNavigator) for navigating records. A NorthwindDataSet, CustomersTableAdapter, BindingSource, and BindingNavigator appear in the component tray.


var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl219a44aef,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl21img,";Creating Controls to Display Data from the Orders Table
To create controls to display the orders for each customer (child records)
  • In the Data Sources window, expand the Customers node and select the last column in the Customers table, which is an expandable Orders node beneath the Fax column, and drag it onto the bottom of Form1. (This node in the Customers table hierarchy represents the related orders for a customer, as opposed to the main Orders node, which represents all records in the Orders table and not the orders for an individual customer.)
    A <A onclick="javascript:Track('ctl00_LibFrame_ctl21|ctl00_LibFrame_ctl22',this);" href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview(VS.80).aspx">DataGridView is added to the form, and a new BindingSource component (OrdersBindingSource) and TableAdapter (OrdersTableAdapter) are added to the component tray.
    ms171884.note(en-US,VS.80).gif
    Note Open the Properties window and select the OrdersBindingSource component. Inspect the DataSource and DataMember properties to see how data binding is configured to display related records. The DataSource is set to the CustomersBindingSource (the parent table's BindingSource), as opposed to the Orders table. The DataMember property is set to FK_Orders_Customers, which is the name of the DataRelation object that relates the tables to each other.


var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl267a49e2c,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl26img,";Testing the Application
To test the application
  1. Press F5.
  2. Select different customers to verify that the correct orders are displayed in the grid on the form.


var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl2767c9073,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl27img,";<A class=CollapseRegionLink onclick="ShowHideCollapsibleArea('ctl00_LibFrame_ctl2767c9073','ctl00_LibFrame_ctl27img');return false;" href="http://msdn2.microsoft.com/en-us/library/ms171884(VS.80).aspx#">
minus.gif
Next Steps
Depending on your application requirements, there are several steps you may want to perform after creating a master-detail form. Some enhancements you could make to this walkthrough include:
  • Editing the query that loads data into the application with the TableAdapter wizards. For more information, see <A onclick="javascript:Track('ctl00_LibFrame_ctl27|ctl00_LibFrame_ctl28',this);" href="http://msdn2.microsoft.com/en-us/library/ms171903(VS.80).aspx">How to: Edit TableAdapter Queries, and How to: Edit TableAdapters.
  • Adding validation to verify the correct data is being entered before sending changes to the database. For more information, see Validating Data.

var ExpCollDivStr = ExpCollDivStr;ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl31719461f,";var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl31img,";See Also
Concepts

<A onclick="javascript:Track('ctl00_LibFrame_ctl31|ctl00_LibFrame_ctl32',this);" href="http://msdn2.microsoft.com/en-us/library/87sfaezs(VS.80).aspx">What's New in Data
Displaying Data Overview
Other Resources

Data Walkthroughs
Getting Started with Data Access
Connecting to Data in Visual Studio
Preparing Your Application to Receive Data
Fetching Data into Your Application
Displaying Data on Forms in Windows Applications
Editing Data in Your Application
Validating Data
Saving Data
 
Whoa slow down....:eek:

Ok before I read into all your post re this comment:

Please, tell me how you can possibly perform this set of steps that noone told you to do, when all you had to do was click one link, either read or use Ctrl+F to find the relevant link, then take your hand off the mouse and read

Easy?

I clicked on your link DW2
It opens a page witn NO tree titled Data WalkThroughs
The third link is Walkthrough: Connecting to Data in a SQL Server Express Database
As stated it is the first one I saw mentioning SQL Express
On that page the Prerequistes provides a link to create the table.

I did not wonder aimlessly around as you suggest I did?

----
You dont *have* to read the "For more information see Creating Windows-based Applications" link. Creating a new empty project isnt rocket science. Dont divert into the first link you come across. If a link decribes something that absolutely really is blocking your progress then read it. Stuff like "if you dont have the northwind sample database installed, see here"
Yes, read that article. Install that Northwind database, but stick with the main article youre following.. The Simple App one..
----

True but as I need a database of the same structure to import from the Northwind I would need to create one wouldn't I?

I dont read every link just the ones that I the reader interpret that I have to?

----

For the avoidance of any doubt. Here is the actual article I wanted you to read (DW2, Simple App link) with the slight problem that the inline links dont work (all the <a href= javascript guff> - if you want those to work, see the main article on Microsoft.com (In the DW2 link, Simple App article):

----

This may bite me in the ass but where in this thread did literally say (DW2, simple App Link).

I appreciate all help offered but unfortunately there are times when I either totally misunderstand or miss a crucial point thus burying myself in a pit of bother:eek:

But all I did was click on DW2 and chose 3rd link as it mentioned SQL Express!

Sorry :eek:
 
I dont think I mentioned it in this thread; I was under the impression that I'd told you in another thread, but given that I tell so many people the same thing about the DW2 links (I sometiems tell them several times in multiple threads, and I dont honestly know or remember who they all are), I apologize if I never told you specifically which link to read.. Sorry.

The menu on the left might be hidden, like a tool window. Drag the light blue bar at the window left edge or double click the handle.

Either way, if yorue starting over, Start with DW2 link, Simple Data Application.. You can get a list of further reading from the end of the article, but just play with the sample app you made as much as possible and work out why it works and what stuff does. Then, you can use the walkthroughs list as an index to what you need to do (a bit like learning a language; you dont read the dictionary, you learn a bit from guides and then use the dictionary for lookup once you start to wonder on something)
 
Back
Top