How to alter table with SQL CE on Windows Phone 7? - linq-to-sql

Let say I deploy a v1.0 of a WP7 with a SQL CE database. In the version v1.1 I need to add a new column to one of the table.
What is the recommend way to do that ? Is there a way to detect if the column exists and create it if needed ?
Thanks,
Jeremy

You can use the DatabaseSchemaUpdater class if you are adding columns etc - see this MSDN article: http://msdn.microsoft.com/en-us/library/hh394022(v=VS.92).aspx

Related

Changing PK-FK -> 'Identity System' ASP.NET --> with MySql Database

-->
I am using mysql database with:
Asp.net mvc project: 6.0 (Long-term support)
Authentication type: 'Individual accounts'
Question 1) I want to change the PK UserId to 'Email' in the scaffolded table: AspNetUsers.
I created a class extending IdentityUser and override email to change the PK. But it raises the issue PK-FK constraint in identity scaffolded tables (ex. AspNetClaims, AspNetRoles,...). What is the best way to solve the issue?
Might need to add something in DbContext - onModelCreating() method. Can anyone suggest how to configure it?
Question 2) Is using .net version 6.0 is compatible with my use case? (mysql database and changing PK-FK)? Or I should use .net 3.1?
Question 3) Should I use Userid (PK of scaffolded AspnetUsers table) in my other mysql tables to not get into any trouble of changing PK-FK constraints?
Question 4) Is there any way to indicate any changes required, and then application generates initial migration document for 'identity system schema'? To skip all this problem? Or Visual Studio should introduce something like that?
Question 5) What is your suggestion to code for 'role-based-login-application'? Should I use Identity System? Or any other session based structure?
Code: Sorry, I have no code to mention here for reference.

How to create table using query in windows phone 8?

I am developing windows phone app. I have searched and find the solution of database connectivity. But it shows database connecting using context class and linq without sql query.
Is it possible to write pure sql query? Ex. "create table emp(eid int, ename varchar(45))".
Any one assist me to handle the logic?
Thanks in advance.
No, if you use SQL Server Compact you can only add tables and columns via your LINQ to SQL classes, no raw SQL access is possible.
Have you looked at the DatabaseSchemaUpdater class?
One possible solution may be to use SQLite.

Enter data in geography column in SQL Server management studio

I've created a new table in SQL Server Management Studio, which includes a Geography column.
Now, I'm trying to enter data in this column using the SSMS UI, but I just can't find the right way of doing it.
So, how can that be done?
I wouldn't think SSMS natively supports doing this with a nice interface (e.g. a map). Maybe there's some add-on to allow this, or likely some 3rd party app.
If you're happy with doing it in SQL, try this:
UPDATE tableName SET geographyColumn = geography::Point(47.65100, -122.34900, 4326)
Derived from here.
Here are 4 more ways to do the same.
If editing a table cell a la mano just type in
POINT (2.434548 48.858319 4326)

How to link oracle table with ax 2009 table?

I have to pull data from Oracle's "A-Table" on daily basis and insert the same to Ax "A-Table".
Can anyone please tell me how can I achieve the same.
Thanks
You need to download the Oracle drivers for Windows ( http://www.oracle.com/technetwork/developer-tools/visual-studio/downloads/index.html ).
Then take a look at this http://floditt.blogspot.mx/2011/08/using-adonet-with-x.html. Instead of using System.Data.SqlClient data types you have to use the oracle classes (System.Data.OracleClient.OracleConnection, OracleCommand, OracleReader, etc...) which you have installed previously.
If you want it to be run everyday just set a new batch job (in Base -> Inquiries -> Batch job).

How to add relation between two tables in Mysql using Mysql control center

I want to create two tables with one to many relations. I use MySql Control center,but I did not find to add foreign key.I do not want to use console commands,How can I do? I also want to use transation so I use InnoDB table type, How can I add relation between two tables in Control Center.Is there another GUI software to handle Mysql?Pls tell me.
You should check SQLYog by Webyog
http://www.webyog.com/en/downloads.php#sqlyog
Why don't you give a try to MySQL Workbench 5.1 OSS it can do the job for, after created the entity you just export it as SQL format or XML as you wish, then import to your mysql database.
Folow the link Download Here