Difference between revisions of "DD Class14"

esse quam videri
Jump to: navigation, search
m (Text replacement - "syntaxhighlight lang="csharp" line="1" " to "syntaxhighlight lang="csharp"")
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Data Design]]
 
[[Category:Data Design]]
  
xml and objects
+
==Inclass Review Project==
  
Backup and Restore
+
http://iam.colum.edu/dd/classsource/class14/website1.zip
  
Export
+
==Review==
 +
 
 +
*.NET
 +
**Web froms
 +
***.NET Controls
 +
***Validation
 +
***Event Model
 +
***Data Binding
 +
***SQLDataSource
 +
***ObjectDataSource
 +
***ADO
 +
****ADO Objects
 +
****Transactions
 +
**LINQ
 +
***DataContext
 +
***DBML
 +
***Model Binding (repo)
 +
***Tansactions
 +
 
 +
*SQL
 +
**Basic SQL INSERT, UPDATE, DELETE, SELECT
 +
**Normal forms 1NF, 2NF, 3NF
 +
***Primary and Candidate keys
 +
***Foreign Key Relationships
 +
***Views and Joins
 +
**Relation ships One-Many, Many-Many
 +
** Aggregate Functions
 +
**Transactions
 +
***Stored Procedures
 +
 
 +
*Patterns
 +
**Repo
 +
**MVC
 +
 
 +
==Email==
 +
===Send Mail===
 +
<syntaxhighlight lang="csharp"><% @Page Language="C#" %>
 +
<% @Import Namespace="System.Web.Mail" %>
 +
<%
 +
    //set up some strings for the email
 +
   
 +
    string strTo = "only_a_test@fastmail.fm";
 +
    string strFrom = "jeff@interactive.colum.edu";
 +
    string strSubject = "Hi jeff";
 +
    string strBody = "A real nice body text here";
 +
   
 +
    //Send email
 +
    SmtpMail.SmtpServer = "localhost";
 +
    SmtpMail.Send(strFrom, strTo, strSubject, strBody);
 +
%></syntaxhighlight>
 +
http://iam.colum.edu/oop/classsource/class14/mail.aspx
 +
[[http://iam.colum.edu/oop/gbrowser.php?file=/classsource/class14/mail.aspx -source]]
 +
 
 +
==xml and objects==
 +
 
 +
All data objects in .Net are make up of xml and and xml schema. The xml is available by calling
 +
 
 +
DataSet.WriteXml
 +
 
 +
and
 +
 
 +
DataSet.WriteXmlSchema
 +
 
 +
http://iam.colum.edu/dd/classsource/class14/class.aspx [http://iam.colum.edu/dd/gbrowser.php?file=/classsource/class14/class.aspx -source]
 +
 
 +
This makes it easy to store objects in a database or send them from on machine to another.
 +
 
 +
==Backup and Restore==
 +
 
 +
The data files can be detached from the server
 +
 
 +
[[Image:DataBaseTakeOffline.png]]
 +
 
 +
Once a database is detached the data files my be copied to another server. You need to have access to the file system on the data server to do this.
 +
 
 +
the database may also be backed up and restored using the Management Studio.
 +
 
 +
==Export==
 +
 
 +
You can backup the work you did on your database by generating an sql script for you database.
 +
 
 +
[[Image:GenerateScript.png]]
 +
 
 +
this will start the wizard to generate sql script
 +
 
 +
[[Image:GenerateScriptWizard.png]]
 +
 
 +
notice that the generated script does not contain any data.
 +
 
 +
You can export the data to an access database.
 +
 
 +
Start by making an empty access database.
 +
 
 +
file new blank database.
 +
 
 +
Save the empty database. Now use the use the import/export wizard from Server Management Studio
 +
 
 +
[[Image:SqlImportExportManager.png]]
 +
 
 +
Choose the source
 +
 
 +
[[Image:SqlImportExportManager2.png]]
 +
 
 +
Select the emptry access as the destination
 +
 
 +
[[Image:SqlImportExport3.png]]
 +
 
 +
Select the data you want to export. Access uses some different data types and has different max sizes but most fields will fit.
 +
 
 +
Don't smpke crack and carefully review what you are about to do the run the package.
 +
 
 +
[[Image:SqlImportExport4.png]]
  
 
==homework==
 
==homework==
  
finish final project
+
[[Data Design Final 2012]]
 +
 
 +
You will have until the end of class next week to finish final project. The requirement for the project may change.
 +
 
 +
study for final exam. The exam will be in two parts
 +
# SQL and .NET questions
 +
# Practical section you will need to build a page or two that connect in various ways the a sql db.
 +
 
 +
[[Data Design Final Review]]

Latest revision as of 03:20, 9 February 2016


Inclass Review Project

http://iam.colum.edu/dd/classsource/class14/website1.zip

Review

  • .NET
    • Web froms
      • .NET Controls
      • Validation
      • Event Model
      • Data Binding
      • SQLDataSource
      • ObjectDataSource
      • ADO
        • ADO Objects
        • Transactions
    • LINQ
      • DataContext
      • DBML
      • Model Binding (repo)
      • Tansactions
  • SQL
    • Basic SQL INSERT, UPDATE, DELETE, SELECT
    • Normal forms 1NF, 2NF, 3NF
      • Primary and Candidate keys
      • Foreign Key Relationships
      • Views and Joins
    • Relation ships One-Many, Many-Many
    • Aggregate Functions
    • Transactions
      • Stored Procedures
  • Patterns
    • Repo
    • MVC

Email

Send Mail

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
<%
    //set up some strings for the email
    
    string strTo = "only_a_test@fastmail.fm";
    string strFrom = "jeff@interactive.colum.edu";
    string strSubject = "Hi jeff";
    string strBody = "A real nice body text here";
    
    //Send email
    SmtpMail.SmtpServer = "localhost";
    SmtpMail.Send(strFrom, strTo, strSubject, strBody);
%>

http://iam.colum.edu/oop/classsource/class14/mail.aspx [-source]

xml and objects

All data objects in .Net are make up of xml and and xml schema. The xml is available by calling

DataSet.WriteXml

and

DataSet.WriteXmlSchema

http://iam.colum.edu/dd/classsource/class14/class.aspx -source

This makes it easy to store objects in a database or send them from on machine to another.

Backup and Restore

The data files can be detached from the server

DataBaseTakeOffline.png

Once a database is detached the data files my be copied to another server. You need to have access to the file system on the data server to do this.

the database may also be backed up and restored using the Management Studio.

Export

You can backup the work you did on your database by generating an sql script for you database.

GenerateScript.png

this will start the wizard to generate sql script

GenerateScriptWizard.png

notice that the generated script does not contain any data.

You can export the data to an access database.

Start by making an empty access database.

file new blank database.

Save the empty database. Now use the use the import/export wizard from Server Management Studio

SqlImportExportManager.png

Choose the source

SqlImportExportManager2.png

Select the emptry access as the destination

SqlImportExport3.png

Select the data you want to export. Access uses some different data types and has different max sizes but most fields will fit.

Don't smpke crack and carefully review what you are about to do the run the package.

SqlImportExport4.png

homework

Data Design Final 2012

You will have until the end of class next week to finish final project. The requirement for the project may change.

study for final exam. The exam will be in two parts

  1. SQL and .NET questions
  2. Practical section you will need to build a page or two that connect in various ways the a sql db.

Data Design Final Review