简体   繁体   English

将数据库从Django Project(sqlite)移至Visual Studio 2010

[英]Move database from Django Project (sqlite) to Visual Studio 2010

I started a project using django & python, but have since decided that it will be done in Visual Studio 2010 using c#. 我使用django和python启动了一个项目,但此后决定将在Visual Studio 2010中使用c#完成该项目。 Im a newbie when it comes to all of these by the way. 顺便说一下,所有这些都是我的新手。

I followed a load of tutorials to get some stuff going in django, including creating a database and adding a fair amount of info to it. 我遵循了大量的教程,以获取有关django的一些知识,包括创建数据库并向其中添加大量信息。

Now i would like to 'transfer' this database from django on one system to vs2010 on a different system. 现在,我想将此数据库从Django的一个系统“转移”到另一系统的vs2010。

Is there anyway i can do this? 反正我能做到吗? what would be the best? 最好的是什么?

The django database was created in sqlite Django数据库是在sqlite中创建的

I don't know nothing about visual studio, and you aren't saying what the "other" sytem. 我对Visual Studio一无所知,而且您不是在说“其他”系统。 So, for the question: 所以,对于这个问题:

Is there anyway i can do this? 反正我能做到吗? what would be the best? 最好的是什么?

Are you thinking we can answer a question like that? 您是否认为我们可以回答这样的问题?

Well, what i can say is that you can get the database in json format using dumpdata and then in visual studio read that info and save into new db. 好吧,我可以说的是,您可以使用dumpdata获取json格式的数据库,然后在Visual Studio中读取该信息并保存到新数据库中。

python manage.py dumpdata myapp > myfile.json

Further to what @Darwin says there is not necessarily any need to recreate the database. 除了@Darwin所说的以外,不必重新创建数据库。 If you are happy with the schema you can just copy the SQLite database into your working directory in visual studio and connect to it using your chosen database access class. 如果您对架构感到满意,则只需将SQLite数据库复制到Visual Studio中的工作目录中,然后使用所选的数据库访问类连接到该目录即可。 See this post for information on C# wrappers. 有关C#包装程序的信息,请参见这篇文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM