I am creating a MySQL table using the following syntax:
protected void CreateTable()
{
string sql;
MySqlCommand c;
sql = "CREATE TABLE MyTable(my_id integer,
description
varchar(20))";
c = new MySqlCommand(sql, dbcon);
try
{
c.ExecuteNonQuery();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
}
It works okay. However I want the id field to be the key
and auto
increment. Can someone show me what the SQL would look
like?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopers googlegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---
|