C# Programming
11-11-2009, 07:14 AM
Hi everyone...
I'm using an SQL Server Compact Edition
I can do all the queries without a problem but I cannot create a table.
in the runtime, when it comes to create a table, the line of the "ExecutNonQuery" gives an error:
"There was an error parsing the query [Token line number=1, Token line offset = 14]..etc"
I now that this kind of error appears when your SQL command syntax is wrong
can anybody tell me what is my fault?
string CreCom = "CREATE TABLE " + TCkim + YilBox.Text + " (Aylar nvarchar (10), Statu nvarchar (20), Odeme nvarchar (20), Servis nvarchar (20), Kiyafet nvarchar (20), Kitap nvarchar (20), Tiyatro nvarchar (20), Sinema nvarchar (20), Yemek nvarchar (20), Muze nvarchar (20), Piknik nvarchar (20), Parti nvarchar (20), Diger nvarchar (20), Yoklama nvarchar (20), Aylik nvarchar (20), Odenen nvarchar (20), Kalan nvarchar (20))";
SqlCeCommand CreateCommand = new SqlCeCommand(CreCom, conn);
CreateCommand.ExecuteNonQuery();
note: SqlCeCommand is the "SqlCommand" for Compact Edition. Usage is all the same
I'm using an SQL Server Compact Edition
I can do all the queries without a problem but I cannot create a table.
in the runtime, when it comes to create a table, the line of the "ExecutNonQuery" gives an error:
"There was an error parsing the query [Token line number=1, Token line offset = 14]..etc"
I now that this kind of error appears when your SQL command syntax is wrong
can anybody tell me what is my fault?
string CreCom = "CREATE TABLE " + TCkim + YilBox.Text + " (Aylar nvarchar (10), Statu nvarchar (20), Odeme nvarchar (20), Servis nvarchar (20), Kiyafet nvarchar (20), Kitap nvarchar (20), Tiyatro nvarchar (20), Sinema nvarchar (20), Yemek nvarchar (20), Muze nvarchar (20), Piknik nvarchar (20), Parti nvarchar (20), Diger nvarchar (20), Yoklama nvarchar (20), Aylik nvarchar (20), Odenen nvarchar (20), Kalan nvarchar (20))";
SqlCeCommand CreateCommand = new SqlCeCommand(CreCom, conn);
CreateCommand.ExecuteNonQuery();
note: SqlCeCommand is the "SqlCommand" for Compact Edition. Usage is all the same