how to create mysql db programmably
Hi, I want to create a mysql table in a database in C#. this table
should have unlimited fields where the user can add more information to
it without having to overwrite the already existing information. I want
to do this cos I will not know the amount of info the user will add in
the table and this will give the user the ability to add as much info
as and when it is available without the need to restructure the table.
can I do that programmably and how?
Nilanka DharmadasaPosted Nov 10, 2009, 5:08 AM
It is possible.
First you create a table with fixed number of columns.
Then when you add a new columns you have to make sure to do one of the following.
1. New column allows null.
2.Set a defaut value to new column
Then you won;t have to rewrite to old records. It will store the null value or default value for the old records.
Refer to following link for more information on syntax.
http://www.functionx.com/mysqlnet/csharp/Lesson05.htm
naura paxPosted Nov 10, 2009, 5:07 AM
by the way, do you have any structure defined for your 'on the fly ' table(s)? Please share the problem with us and give complete requirements if possible.