I have the following code and I use it in vb.net project It works well if there is no place in the database name, for example, if the name of the database is "sample company" then it works fine, but if the name of the database changes in "sample company" then we Generates an error in the command: "Start Table" & amp; Cn.Database. We should be able to handle / without database spaces without database names.
Any suggestions to solve this problem? Thank you
cn.Database = "sample company" sqlCreate = "If not present (select notification * from Sachecha. Tablels where tabline = 'cloud_user settings' and 'tablecatOlg ='" & CN. Database & amp; "')" & amp; _ "Create tabs" & amp; Cn.Database & amp; ".dbo.Cloud_UserSetting (Cloud is not Intel, name varchar (100) No, zero," & amp; _ "varchar setting (250) NULL" & _ "CONCRETET PK_Cloud_User Primary key classification (CloudId, name)) END "Command = new SqlCommand (sqlCreate, cn) command.ExecuteNonQuery ()
Use square brackets for column names and table names.
Example: Instead of table name
: [table name]
No comments:
Post a Comment