| |
|
|
|
|
|
|
|
|
|
 |    |  |
 | |  |
 | |  |
 | |  |
 | |  |
 |
|
|
| Having trouble with custom module and stored procedures |
|
|
Ok, I'm trying to add a stored procedure using this tutorial ...
http://www.codeproject.com/aspnet/Creating_A_DNNModule.asp#CreateStoredProcedure
I have modified the script to reflect my table, here it is...
CREATE PROCEDURE {databaseOwner}
[{objectQualifier}NN_Biz_Delete]
(
@Biz_ID int
)
AS
DELETE FROM {objectQualifier}NN_Biz
WHERE (Biz_ID = @Biz_ID)
RETURN
GO
CREATE PROCEDURE {databaseOwner}
[{objectQualifier}NN_Biz_GetAll]
(
@ModuleID int
)
AS
SELECT Biz_ID, ModuleID, Biz_Name, Biz_Category, Zip, Address,
Web_Link, Phone1, Fax, Date_Start, Date_End, Date_Entered, Author,
NHood_ID, Email
FROM {objectQualifier}NN_Biz
WHERE (ModuleID = @ModuleID)
order by Biz_Name DESC
RETURN
GO
CREATE PROCEDURE {databaseOwner}
[{objectQualifier}NN_Biz_Insert]
(
@ModuleID int,
@Biz_Name nvarchar(50),
@Biz_Category nvarchar(50),
@Zip nchar(5)
)
AS
INSERT INTO {objectQualifier}NN_Biz
(ModuleID, Biz_Name, Biz_Category, Zip, Date_Entered)
VALUES (@ModuleID,@Biz_Name,@Biz_Category,@Zip,getdate())
RETURN
GO
CREATE PROCEDURE {databaseOwner}
[{objectQualifier}NN_Biz_Update]
(
@Biz_ID int,
@Biz_Name nvarchar(50),
@Biz_Category nvarchar(50),
@Zip nchar(5),
@Date_Entered datetime
)
AS
UPDATE {objectQualifier}NN_Biz
SET Biz_Name = @Biz_Name, Biz_Category = @Biz_Category,
Zip = @Zip, Date_Entered = @Date_Entered
WHERE (Biz_ID = @Biz_ID)
RETURN
GO
I am getting error messages saying...
System.Data.SqlClient.SqlException:
Invalid column name 'GO'. at
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection) at
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior
runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String
methodName, Boolean async) at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe) 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. [NN_Biz_Delete] (
@Biz_ID int
)
AS
DELETE FROM NN_Biz
WHERE (Biz_ID = @Biz_ID)
RETURN
GO
Any Ideas where I am going wrong?
Here is my table which is called NN_Biz
1 Biz_ID int 4 0
0 ModuleID int 4 0
0 Biz_Name nvarchar 50 0
0 Biz_Category nvarchar 50 0
0 Zip nchar 5 0
0 Address nvarchar 50 0
0 Web_Link nvarchar 50 1
0 Phone1 nchar 10 0
0 Fax nchar 10 1
0 Date_Start datetime 8 1
0 Date_End datetime 8 1
0 Date_Entered datetime 8 0
0 Author nvarchar 50 0
0 NHood_ID char 10 0
0 Email nvarchar 50 1
|
|
|
|
 |  |
|
| |
|  |
 | |  |
 | |  |
 | |  |
|  |
| |
 |
|
These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.
For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:
1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.
|
| |
 |
|
|
|
|
|
|
|