Skip to content

Commit

Permalink
1. Using UTF-16 for encoding in order to get the scripts to populate …
Browse files Browse the repository at this point in the history
…data properly.

2. Updating SQL scripts to use Unicode strings.
3. Creating unit test to verify that data is properly encoded.
4. Adding CreatAll.bat to create all databases.

--HG--
extra : convert_revision : svn%3A620c4292-3293-3848-9960-d3592df64433/Trunk%405
  • Loading branch information
lerocha committed Aug 17, 2008
1 parent 792c4fe commit 27a9ed4
Show file tree
Hide file tree
Showing 21 changed files with 8,023 additions and 7,472 deletions.
4 changes: 2 additions & 2 deletions Source/ChinookDatabase/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<connectionStrings>
<add name="ChinookSqlServer" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=Chinook;Integrated Security=SSPI;Persist Security Info=False;" providerName="System.Data.SqlClient" />
<add name="ChinookMySql" connectionString="Server=localhost;Database=Chinook;Uid=root;Pwd=passwd;"/>
<add name="ChinookOracle" connectionString="Provider=msdaora;Data Source=xe;User Id=chinook;Password=passwd;"/>
<add name="ChinookMySql" connectionString="Server=localhost;Database=Chinook;Uid=root;Pwd=p4ssw0rd;"/>
<add name="ChinookOracle" connectionString="Provider=msdaora;Data Source=xe;User Id=chinook;Password=p4ssw0rd;"/>
</connectionStrings>
</configuration>
9 changes: 9 additions & 0 deletions Source/ChinookDatabase/ChinookDatabase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
<None Include="Schema\ChinookDataSet.xss">
<DependentUpon>ChinookDataSet.xsd</DependentUpon>
</None>
<None Include="Scripts\CreateAll.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Scripts\MySql\CreateDB.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -173,4 +176,10 @@
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>@echo off
cd Scripts
rem CreateAll.bat
cd ..</PostBuildEvent>
</PropertyGroup>
</Project>
Binary file modified Source/ChinookDatabase/SampleData/ChinookData.tt
Binary file not shown.
Binary file modified Source/ChinookDatabase/SampleData/ChinookData.xml
Binary file not shown.
37 changes: 22 additions & 15 deletions Source/ChinookDatabase/SampleData/ManualData.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<DataSet xmlns="http://tempuri.org/DataSet.xsd">
<!--
!!!IMPORTANT!!!
The first customer (CustomerId == 1) is used by
the unit test RecordsWithProperUnicodeCharacters.
Please do not change this record. If you do so,
then use Unicode characters to enable the Unicode testing.
-->
<Customer>
<CustomerId>1</CustomerId>
<FirstName>Luís</FirstName>
<LastName>Gonçalves</LastName>
<Company>Embraer - Empresa Brasileira de Aeronáutica S.A.</Company>
<Address>Av. Brigadeiro Faria Lima, 2170</Address>
<City>Săo José dos Campos</City>
<State>SP</State>
<Country>Brazil</Country>
<PostalCode>12227-000</PostalCode>
<Phone>+55 (12) 3923-5555</Phone>
<Fax>+55 (12) 3923-5566</Fax>
<Email>[email protected]</Email>
</Customer>
<Customer>
<CustomerId>2</CustomerId>
<FirstName>Eduardo</FirstName>
<LastName>Martins</LastName>
<Company>Woodstock Discos</Company>
Expand All @@ -15,7 +36,7 @@
<Email>[email protected]</Email>
</Customer>
<Customer>
<CustomerId>2</CustomerId>
<CustomerId>3</CustomerId>
<FirstName>Alexandre</FirstName>
<LastName>Rocha</LastName>
<Company>Banco do Brasil S.A.</Company>
Expand All @@ -28,20 +49,6 @@
<Fax>+55 (11) 3055-8131</Fax>
<Email>[email protected]</Email>
</Customer>
<Customer>
<CustomerId>3</CustomerId>
<FirstName>Paula</FirstName>
<LastName>Britto</LastName>
<Company>Embraer S.A.</Company>
<Address>Av. Brigadeiro Faria Lima, 2170</Address>
<City>Săo Jose dos Campos</City>
<State>SP</State>
<Country>Brazil</Country>
<PostalCode>12227-000</PostalCode>
<Phone>+55 (12) 3923-5555</Phone>
<Fax>+55 (12) 3923-5566</Fax>
<Email>[email protected]</Email>
</Customer>
<Customer>
<CustomerId>4</CustomerId>
<FirstName>Roberto</FirstName>
Expand Down
142 changes: 71 additions & 71 deletions Source/ChinookDatabase/Schema/ChinookDataSet.xsd

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions Source/ChinookDatabase/Schema/ChinookDataSet.xss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="True" ViewPortX="-75" ViewPortY="-37" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="True" ViewPortX="-75" ViewPortY="-55" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:Genre" ZOrder="2" X="532" Y="94" Height="61" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="57" />
<Shape ID="DesignTable:MediaType" ZOrder="3" X="535" Y="-3" Height="61" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="57" />
Expand All @@ -29,15 +29,15 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_Album_Track" ZOrder="15" LineWidth="11">
<Connector ID="DesignRelation:FK_Genre_Track" ZOrder="1" LineWidth="11">
<RoutePoints>
<Point>
<X>137</X>
<Y>55</Y>
<X>532</X>
<Y>124</Y>
</Point>
<Point>
<X>270</X>
<Y>55</Y>
<X>420</X>
<Y>124</Y>
</Point>
</RoutePoints>
</Connector>
Expand All @@ -53,15 +53,15 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_Genre_Track" ZOrder="1" LineWidth="11">
<Connector ID="DesignRelation:FK_Album_Track" ZOrder="15" LineWidth="11">
<RoutePoints>
<Point>
<X>532</X>
<Y>124</Y>
<X>137</X>
<Y>55</Y>
</Point>
<Point>
<X>420</X>
<Y>124</Y>
<X>270</X>
<Y>55</Y>
</Point>
</RoutePoints>
</Connector>
Expand Down Expand Up @@ -89,18 +89,6 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_Customer_Invoice" ZOrder="16" LineWidth="11">
<RoutePoints>
<Point>
<X>146</X>
<Y>488</Y>
</Point>
<Point>
<X>267</X>
<Y>488</Y>
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_Employee_Invoice" ZOrder="17" LineWidth="11">
<RoutePoints>
<Point>
Expand All @@ -113,15 +101,15 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_ProductItem_InvoiceLine" ZOrder="14" LineWidth="11">
<Connector ID="DesignRelation:FK_Customer_Invoice" ZOrder="16" LineWidth="11">
<RoutePoints>
<Point>
<X>338</X>
<Y>173</Y>
<X>146</X>
<Y>488</Y>
</Point>
<Point>
<X>338</X>
<Y>222</Y>
<X>267</X>
<Y>488</Y>
</Point>
</RoutePoints>
</Connector>
Expand All @@ -137,5 +125,17 @@
</Point>
</RoutePoints>
</Connector>
<Connector ID="DesignRelation:FK_ProductItem_InvoiceLine" ZOrder="14" LineWidth="11">
<RoutePoints>
<Point>
<X>338</X>
<Y>173</Y>
</Point>
<Point>
<X>338</X>
<Y>222</Y>
</Point>
</RoutePoints>
</Connector>
</Connectors>
</DiagramLayout>
42 changes: 42 additions & 0 deletions Source/ChinookDatabase/Scripts/CreateAll.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@echo off

echo =====================================================================
echo Creating SqlServer Database...
echo =====================================================================
cd SqlServer
call CreateDB.bat
IF ERRORLEVEL 1 GOTO ERROR
cd..
echo.

echo =====================================================================
echo Creating MySql Database...
echo =====================================================================
cd MySql
call CreateDB.bat
IF ERRORLEVEL 1 GOTO ERROR
cd..
echo.

echo =====================================================================
echo Creating Oracle Database...
echo =====================================================================
cd Oracle
call CreateDB.bat
IF ERRORLEVEL 1 GOTO ERROR
cd..
echo.

goto EXIT

:ERROR
cd..
echo.
echo =====================================================================
echo An error occured when creating databases. Please review errors above.
echo =====================================================================
echo.
goto EXIT

:EXIT

3 changes: 2 additions & 1 deletion Source/ChinookDatabase/Scripts/MySql/CreateDB.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mysql -h localhost -u root -p <CreateDB.sql
@echo off
mysql -h localhost -u root --password=p4ssw0rd <CreateDB.sql
Loading

0 comments on commit 27a9ed4

Please sign in to comment.