Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Criando bancos de dados e tabelas usando c#


Para criar uma tabela:
string createString = "CREATE TABLE myTable (column1 INT, column2 NVARCHAR(10))"; //YOUR SQL COMMAND TO CREATE A TABLE
SqlConnection connection = new SqlConnection(YOUR CONNECTION STRING);

SqlCommand create = new SqlCommand(createString , connection);

connection.Open();
create.ExecuteNonQuery();
connection.Close();