1

I am using system.data.sqlite for in memory testing, and i wanted to know if any of you got a link or knowledge for a open source project that simply create database and tables ?

For example :

InMemoryDB db = new  InMemoryDB();
Table t = new Table("myTable");
t.Add(new Coloum("Uid",DbType.VarChar,PrimeryKey = true));
db.Add(t);

or even a better idea ?

1 Answer 1

4

Just use "Data Source=:memory:" as your connection string, and manipulate the DB directly in SQL

Sign up to request clarification or add additional context in comments.

4 Comments

do you think if i create some generic project like that it would be helpful for developers ?
A project to do what? create the DB schema from code? There are already tools that can do it, ORMs like Entity Framework or NHibernate
For some reason, this fails if I have the spaces around the = but it works fine if I use "Data Source=:memory:"
@default.kramer, you're right, there was an error in my syntax. I fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.