|
|
|
Joined: 2/15/2006
Posts: 10
|
|
|
hi
when i setup a new module: i have a issue:
Can u help me? plz
|
StartJob |
Begin Sql execution |
Info |
Executing 01.00.00.SqlDataProvider |
StartJob |
Start Sql execution: 01.00.00.SqlDataProvider file |
EndJob |
End Sql execution: 01.00.00.SqlDataProvider file |
|
Info |
Executing 02.00.00.SqlDataProvider |
StartJob |
Start Sql execution: 02.00.00.SqlDataProvider file |
Failure |
SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: Line 7: Incorrect syntax near '[MaP],'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE dbo.A_ictu_PhongbanSelect @strQuery nvarchar(500) AS DECLARE @sql nvarchar(1000) SELECT @sql = 'SELECT ' '[MaP],' '[ModuleId],' '[Tenphong] ' ' FROM A_ictu_Phongban ' @strQuery EXEC(@sql) System.Data.SqlClient.SqlException: Line 8: Incorrect syntax near '[test1],'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE dbo.VinaStar_DNN_GetArticleByStrQuery @strQuery nvarchar(500) AS DECLARE @sql nvarchar(1000) SELECT @sql = 'SELECT ' '[test1],' '[test2] ' 'FROM Test ' @strQuery EXEC(@sql) |
EndJob |
End Sql execution: 02.00.00.SqlDataProvider file |
|
EndJob |
Finished Sql execution |
|
StartJob |
Begin Sql execution |
Info |
Executing 01.00.00.SqlDataProvider |
StartJob |
Start Sql execution: 01.00.00.SqlDataProvider file |
EndJob |
End Sql execution: 01.00.00.SqlDataProvider file |
|
Info |
Executing 02.00.00.SqlDataProvider |
StartJob |
Start Sql execution: 02.00.00.SqlDataProvider file |
Failure |
SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: Line 7: Incorrect syntax near '[MaP],'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE dbo.A_ictu_PhongbanSelect @strQuery nvarchar(500) AS DECLARE @sql nvarchar(1000) SELECT @sql = 'SELECT ' '[MaP],' '[ModuleId],' '[Tenphong] ' ' FROM A_ictu_Phongban ' @strQuery EXEC(@sql) System.Data.SqlClient.SqlException: Line 8: Incorrect syntax near '[test1],'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE dbo.VinaStar_DNN_GetArticleByStrQuery @strQuery nvarchar(500) AS DECLARE @sql nvarchar(1000) SELECT @sql = 'SELECT ' '[test1],' '[test2] ' 'FROM Test ' @strQuery EXEC(@sql) |
EndJob |
End Sql execution: 02.00.00.SqlDataProvider file |
|
EndJob |
Finished Sql execution |
thanks 4 responsing quickly
best wish to u
|
|
|
|
| |
|
|
www.Jegers.com Joined: 4/6/2006
Posts: 217
|
|
|
Sorry to hear about your issue, but this is the forum for the GALLERY module. It appears that you are trying to load something for the A_ictu_Phongban module. Which I am not familiar with. You will need to contact the support people for that module.
But.. from the SQL debug you sent 'SELECT ' '[MaP],' '[ModuleId],' '[Tenphong] ' ' FROM A_ictu_Phongban
It appears that you have quotes around your select parameters, but I'm assuming that the parameters are supposed to be fields/columns in the database (given you wrapped them in []) and fields/columns don't need quotes around them.
|
|
|
|
| |
|
|
Joined: 2/15/2006
Posts: 10
|
|
|
Thanks 4 responsing .
this is my proc
/-------------------------
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE {databaseOwner}{objectQualifier}A_ictu_PhongbanSelect
@strQuery nvarchar(500)
AS
DECLARE @sql nvarchar(1000)
SELECT @sql = 'SELECT '
+'[MaP],'
+'[ModuleId],'
+'[Tenphong] '
+' FROM {objectQualifier}A_ictu_Phongban '
+ @strQuery
EXEC(@sql)
GO
/-------------------------
this is proc is repaired as u said:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE {databaseOwner}{objectQualifier}VinaStar_DNN_GetArticleByStrQuery2
@strQuery nvarchar(500)
AS
DECLARE @sql nvarchar(1000)
SELECT @sql = 'SELECT [test1],[test2] FROM {objectQualifier}Test '+ @strQuery
EXEC(@sql)
GO
/----------------------------
i am trying delete qoutes but apear errors:
System.Data.SqlClient.SqlException: Line 7: Incorrect syntax near '@strQuery'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE PROCEDURE dbo.VinaStar_DNN_GetArticleByStrQuery2 @strQuery nvarchar(500) AS DECLARE @sql nvarchar(1000) SELECT @sql = 'SELECT [test1],[test2] FROM Test ' @strQuery EXEC(@sql)
thanks u very much
if can: Admin or Mod can answer me ? i need it very quickly
happiness to u
|
|
|
|
| |