Set separator delimiter in CSV file to open correctly in Excel

Problem I made a PHP script to export a SQL query (from MySql) to a CSV file for opening in Excel. I cannot control how different users have their Excel setup, ie what separator delimiter they have set (this differs with language settings or user may have changed setting) So the field separator delimiter gave me some problems,… Continue reading Set separator delimiter in CSV file to open correctly in Excel

MySQL and Visual Studio 2010 Membership, Roles and User Profile Provider

In Visual Studio 2010 (VS2010) when you create a new Web Application Project using the default Web Template “ASP.NET Web Application” it creates an Account folder with the files Login.aspx, Register.aspx and ChangePassword.aspx. These are files/pages for ASP.NET Membership which is ASP.NET’s built-in user handling. I have never used Membership before but have been curious… Continue reading MySQL and Visual Studio 2010 Membership, Roles and User Profile Provider

MySQL Workbench Query Browser is super slow

MySQL GUI Tools which included the MySQL Query Browser and MySQL Administrator has now been replaced by the MySQL Workbench tool. The Workbench edition which includes Query Browser (now called SQL Development) and Administrator (now called Server Administration) is only available in beta but it the old MySQL GUI Tools have already been pulled from… Continue reading MySQL Workbench Query Browser is super slow

MySql.Data.MySqlClient.MySqlException: Parameter ‘@id’ must be defined

I found out a funny thing today. Or maybe not so funny when I think about it… The order page on one of my sites have not been working since early November, almost 6 months!! As I’m sure you understand it’s not a very busy site, but usually I get a few orders per month… Continue reading MySql.Data.MySqlClient.MySqlException: Parameter ‘@id’ must be defined

Copy MySQL Database Structure without Data

Three easy steps to copy the structure of a MySQL database, i.e. the table definitions but no rows/records/data: 1. Create the new database, either from MySQL Query Browser (part of MySQL GUI Tools) or MySQL Command Line: CREATE DATABASE `new_database_name`; 2. Copy the database structure using the mysqldump command from a dos command prompt. Note:… Continue reading Copy MySQL Database Structure without Data

Published
Categorized as MySQL

BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’.

I got this error in one of my ASP.NET web sites after uploading a new version: BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’. It worked fine on my development machine but not on the production server. I could not figure out what it was for quite some time. Turned out I had added the… Continue reading BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’.

Partial Restore of Mysqldump Backup

Just recently I started making backups of my MySQL databases using mysqldump.I have a small batch/command file running on my Windows based MySQL Server, scheduled to every night backup all of my databases to a file named backup_all_dbs.sql: “C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump” –all-databases -u username –password=”password” > c:\backup\%DATE%\Backup_MySQL\backup_all_dbs.sql A few weeks ago I finally upgraded… Continue reading Partial Restore of Mysqldump Backup

Published
Categorized as MySQL

Unable to convert MySQL date/time value to System.DateTime

After switching from MySQL ODBC driver to the .NET connector I have been getting this error: Unable to convert MySQL date/time value to System.DateTime. This is when a DATETIME or DATE field contains an invalid value. It turns out that 0000-00-00 which I have used as default value in a DATE column is considered an… Continue reading Unable to convert MySQL date/time value to System.DateTime