List Info

Thread: MySQL Table Creation




MySQL Table Creation
user name
2006-02-22 03:03:12
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 CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

MySQL Table Creation
user name
2006-02-22 16:23:43
i think this link may help you
mysql 3.23, 4.0, 4.1  =
http://dev.mysql.com/doc/refman/4.1/en/create-table.html

mysql 5.0 = http://dev.mysql.com/doc/refman/5.0/en/create-table.html



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

MySQL Table Creation
user name
2006-02-24 03:52:48
Thanks zaiboot.  Now can you point me to some documentation
that will
teach me to read the documentation?  :/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

MySQL Table Creation
user name
2006-03-04 20:38:21
SQL-query:
CREATE TABLE `MyTable` (
`my_id` INT NOT NULL AUTO_INCREMENT ,
`description` VARCHAR( 20 ) NOT NULL ,
PRIMARY KEY ( `my_id` ) 
);


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )