Here's my code:
string createString = "CREATE TABLE user (uid INT PRIMARY KEY IDENTITY(1,1), uname NVARCHAR(30), uemail NVARCHAR(30), upass NVARCHAR(20), ucontact INT(10))"; //YOUR SQL COMMAND TO CREATE A TABLE
SqlConnection connection = new SqlConnection("Data Source=DELL\\SQLEXPRESS;Integrated Security=True;Connect Timeout=1000000;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
SqlCommand create = new SqlCommand(createString, connection);
connection.Open();
create.ExecuteNonQuery();
connection.Close();
I get the following error:
Incorrect syntax near the keyword 'user'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'user'.