Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Having trouble with custom module and stored proceduresHaving trouble with custom module and stored procedures
Previous
 
Next
New Post
2/1/2006 10:25 PM
 
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

 
New Post
2/2/2006 5:10 AM
 
pay attention on the character coding of your script file and add blank lines after each go.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Having trouble with custom module and stored proceduresHaving trouble with custom module and stored procedures


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out