I want to create table with name of username.The username is written in uname.Text textbox in xaml. I am using SQLHelper for this.I think I am having a problem with syntax.Can anyone correct my syntax in the code given below.
SqlHelper.ExecuteDataset("Data Source=ADMIN-PC\\MSSQL;Initial Catalog=RecordsDB;Integrated Security=True", CommandType.Text, "CREATE TABLE '" + uname.Text + "'(StudentID int,LastName varchar(255),RollNum varchar(255),Address varchar(255),City varchar(255)); ");
Error I am getting: An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: Incorrect syntax near 'abc'.
abc is what i have given as username in textbox