Tips and Tricks in a world of Mix

At the present project I’ve encountered a problem of working with Oracle through the portal of SqlServer .

q: What is the need for it ?

a: Reduction of development time ..

 

So , I have at my project a few tasks :

  1. Create a DB schema and fill it out with temporary data.
  2. Create quickly a code corresponding with database
  3.  Add sources of Oracle to SQL SEVRER .
  4. Include handle of UDT objects .
  5. use it – The download link for SSMA for Oracle.  
  6. Be able to work with web services , maybe RIA services ,  especially with Oracle UDT objects .  This is a sample of Grid Silverlight through RIA Services .

 

If I’d start doing all this things through the procedures of Oracle I would need at least one DB programmer working on it for about a month and a half I think , and then I’d need a .Net programmer that would work on his end for the same amount of time , probably not in parallel , so it would prolong the development in 2 , maybe even more.

 

The goal is to create a DB  in SqlServer and create corresponding entities automatically .

Then create RIA services per entity . (Well RIA Services is really a luxury , so we’ll see how it goes ) .

 

  1. The first move is to build an EDMX in Visual Studio including the Entities you’d like to work with . Here is some example for how to do it . Pay attention that the fields are “Nullable” when needed.
  2. Then , create the associations between the entities . 
  3. Then generate the Sql to create the DDL – fancy abbreviate  for DB schema.
  4. Create your DB first and run the generation code from the Visual Studio .
  5. Add new project of Asp.Net Dynamic Data Domain Service , run it  and add some data to your DB .

Pay attention – you need to add the right connection at the Web.Config of this web project and open the remarks in Global.asax  – ScaffoldAllTables for you Domain Service .

This is a good check for your primary definitions in EDMX  – suddenly you understand your DB more . If needed remake the DB from zero or update the DB and then “Update the Model from Database” (depends how off you were ) .

You can see that there is no option of Updating the DB from EDMX after the First Generation Script . It could create a generation script , but if you’ve already added some data into your DB – it would be lost forever , you need to drop the tables and create them again .

q: SO , why isn’t there an update script for EDMX to update the DB it has created at the beginning?

a: Well, the answer is easy , theoretically , the DB can and even should be used by a few application simultaneously – it saves place to recycle data from application to application . SO, if we have few applications using the same DB and we decide to change it from one of applications it could destroy the normal activity of the other applications .

 

In this post , we’ve covered the creation of the DB – quickly and easy .

Also we’ve created the Web Site that should enter test data very easy and actually test the connections of your entities..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: