October 17, 2009
Well after some more testing, I come to the understanding that the ALTER TABLE statement is rather limited in SQLite.
It seems a bit pointless then to use migrations…
I tried among other this:
Database.AddColumn(“Resource”, “Password”, System.Data.DbType.String, 50);
The SQL itself does not give any errors and the SQLite documentation says this should work. Absolutely nothing happened to my database schema.
This SQLite thing is giving me headaches
I’m still conviced that my idea to use SQLite for development (and in some cases for production) is a solid one. But truly being able to be completely database independant is proving not so simple.
Leave a Comment » |
.Net |
Permalink
Posted by Dennis
October 16, 2009
Owkay, so I really have a problem with my idea to use SQLite for development and MySQL for production.
It seems that composite primary keys cannot be added with the ALTER TABLE statement in SQLite. This is frikkin annoying to say the least.
Migrator.Net uses ALTER TABLE. Maybe I will look at the source code for Migrator.Net because it seems CREATE UNIQUE INDEX would do the trick and this can be used after creation.
I modified the SQLiteTransformationProvider class so it would use the CREATE UNIQUE INDEX statement (and uploaded it to google code) This did the trick.
Next hurdle: I need views in my app. I had this in a migration:
Database.ExecuteNonQuery(“CREATE VIEW vwProject AS “ +
“SELECT dbo.Project.ID, dbo.Project.Name, dbo.Project.CustomerID, dbo.Customer.Name AS CustomerName, dbo.Project.CompanyID “ +
“FROM dbo.Project INNER JOIN dbo.Customer ON dbo.Project.CustomerID = dbo.Customer.ID”);
It failed over the dbo. After removing the dbo it worked fine.
Leave a Comment » |
.Net |
Permalink
Posted by Dennis
October 15, 2009
For some time now, I’ve wanted to know what SQLite was all about. MySQL is fine and dandy, but for development, I always found it to be complete overkill. SQL Server Express for that matter too.
You will probably know I tend to script all my databases with Migrator.Net. Because Migrator.Net has a provider for both SQLite and for Mysql I can do my migrations locally for development with the SQLite provider and upon release migrate a MySQL database.
The only thing I will need to calulate in is the fact I will need a similar provider model for my Data Access Layer.
But… (there is allways a but…) I might have to write unit tests for my providers.
Tonight I did some testing.
- I downloaded System.Data.SQLite from http://sqlite.phxsoftware.com/ but when trying to install it, I gave me an error that something else was already being installed. No, this was not the case… Second time I tried it, it worked
- I made a new solution in Visual Studio 2008 with two projects. One with the migrations and one that uses the database.
- For the migrations, I just copied a migration from an earlier project.
- Searched for a connection string to connect to SQLite, found it on http://www.connectionstrings.com/sqlite
- Ran the migration with:
.\libs\migrator\Migrator.Console.exe SQLite “Data Source=.\SQLiteDatabase\Database.db;Version=3;” .\DBMigrations\bin\Debug\DBMigrations.dll
- In visual studio, I connected to the database.
IT WORKED!
Now I will try to use it in a real project!
UPDATE: I tried more and I got an error on a primary key constraint. It’s probably my lack of knowledge…
Leave a Comment » |
.Net |
Permalink
Posted by Dennis
October 14, 2009
Andrey Sanches has a very nice post here about how to use List.Find().
Notice that the search value is 1, which is a fixed value. That is not allways what you want. Consider for example you want to know if the person exists who’s id the user typed in a textbox…
Leave a Comment » |
.Net, asp.net |
Permalink
Posted by Dennis
August 8, 2008
I’ve finally updated my website today.
For now it is only in Dutch. Sorry for all you English speaking folk. I plan to get a multilingual version up in the next two weeks or so.
I got the design from http://www.freecsstemplates.org/. I could have spent a few euro’s on a custom design but I was happy with it so…
However, I did start from the downloaded HTML and converted it to use ASP.NET master pages and ASP.NET controls.
The content is not yet finished either but at the moment I’m very busy getting my new app out for Communication Management. I’ll write a seperate post on that shortly.
Leave a Comment » |
.Net |
Permalink
Posted by Dennis
August 8, 2008
A customer of mine log all incoming and outgoing comunication with his external relations in an excell spreadsheet. I find this a very good thing to do. He confirms it has helped him numerous times in the past where his customer or vendor gets into a i-did-say-this argument. He can fall back on the communication log an say you said this and that on that day an such.
The spreadsheet did however pose some problems, keeping him from getting the efficiency he needed.
These were his problems:
- When multiple users accessed the sheet, they had to be very carefull not to overwrite each others entries.
- The master data for contacts is in their Microsoft Dynamics NAV system. It is a shame he has the same data in multiple places.
- He cannot run a report from the contact card in NAV to see a log of the communications
- Some users of the Communications Log do not require access to Navision. They don’t even want access. Fact is that NAV licence pricing is user based.
So, he came to me to see if I could address these problems. Of course I could. The first idea we had was to just write some custom solution in NAV. Then I started seeing an opportunity. Surely other businesses could benefit from such software.
Because we wanted to enable non NAV users to use the software we were pushed towards an external app anyway. So, I decided to write an app in ASP.NET. In this first release, I’m focussing on NAV as a the backend. The software is designed pluggable however. This means that I can write a module to access systems other than NAV in a jiffy.
As a marketing stint, I said to the customer that for avery lead he can generate that leads to a sale, he will get free services from me. I tend on pursuing this further for all paying customers.
The software is priced at 500€ ex vat. For every buying lead, I will give back 125€ ex vat in services on the software (such as customisation or maintenance or upgrades).
If anyone is interested in this, please contact me. I have other reward programmes in mind for lead generation.
Leave a Comment » |
.Net |
Permalink
Posted by Dennis