Search
 

Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Merging to fields together
Last Post 06-30-2009 03:34 AM by Thomas Born. 43 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 2 of 2 << < 12
Author Messages
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-15-2009 10:18 AM
Hi Chad,

Here is the query results from the email event message.

usp_certinsert @UserID, '$(allcerts), '$(cert)', ''
David ToUser is Offline
river guide
river guide
Posts:2736
Avatar

--
06-15-2009 11:17 AM
That doesn't look right. You should have something like: usp_certinsert 5, 'Certificates','Cert',''. Can you turn on debug mode? At the top of the URL, append ?debug=true and then continue to fill out your form and then hit submit. You should see what it's actually passing:
usp_certinsert etc.

-- David
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-15-2009 11:26 AM
Here is the email response

?debug=true
usp_certinsert @UserID, '$(allcerts), 'ITIL,GSE,OCA,MCSD,MCSE,Other', 'MP3'
David ToUser is Offline
river guide
river guide
Posts:2736
Avatar

--
06-15-2009 11:33 AM
The UserID should be an integer. That's why it's not executing. You're passing it incorrectly. Also, your $(allcerts) signifies you're missing an ending single quote. Because otherwise it would have a value or a blank ''.
Your passing of parameters should be:

usp_certinsert $(UserID),'$(allcerts)','$(cert)', '$(certother)'

please double-check. -- David
Chad NashUser is Offline
river guide
river guide
Posts:4843
Avatar

--
06-15-2009 11:47 AM
Try this query... I don't think you need the Where clause when setting the value. I also think you had 2() in the query instead of just 2.

begin
declare @allcertsVar nvarchar(500)
declare @allcerts nvarchar(500)
If (@allcerts = '') set @allcertsVar = '$(cert)' + ',$(certother)' else set @allcertsVar = @allcerts
declare @allcertsID int
set @allcertsID = (select PropertyDefinitionID from ProfilePropertyDefinition where PropertyName = 'allcerts')

-- if record doesn't exist, insert a new record
if not exists(select userid from UserProfile where userid =$(UserID) and PropertyDefinitionID = @allcerts)
begin
insert into UserProfile(UserID,PropertyDefinitionID,PropertyValue,Visibility) values($(UserID),@allcerts,@allcertsVar,2)
end
else
-- record exists, update it instead
begin
update UserProfile set PropertyValue = @allcertsVar where UserId = $(UserID)

end

end
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-15-2009 04:03 PM
Hi Chad,

Got the following error message

System.Data.SqlClient.SqlException: Incorrect syntax near '('. Incorrect syntax near '('. Incorrect syntax near 'UserID'. 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 DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) begin declare @allcertsVar nvarchar(500) declare @allcerts nvarchar(500) If (@allcerts = '') set @allcertsVar = '$(cert)' + ',$(certother)' else set @allcertsVar = @allcerts declare @allcertsID int set @allcertsID = (select PropertyDefinitionID from ProfilePropertyDefinition where PropertyName = 'allcerts') -- if record doesn't exist, insert a new record if not exists(select userid from UserProfile where userid =$(UserID) and PropertyDefinitionID = @allcerts) begin insert into UserProfile(UserID,PropertyDefinitionID,PropertyValue,Visibility) values($(UserID),@allcerts,@allcertsVar,2) end else -- record exists, update it instead begin update UserProfile set PropertyValue = @allcertsVar where UserId = $(UserID) end end

Thanks,
Gary
David ToUser is Offline
river guide
river guide
Posts:2736
Avatar

--
06-16-2009 07:47 AM
HI, let's try to resolve this issue asap. I know the SQL stored procedure should work. Can you include a screenshot of your Form completion event so I can verify what you are passing through to the stored procedure because based on the discussion above, the parameters are not being passed correctly. -- David
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-16-2009 08:27 AM
Hi David,

You have a email address I can send the screen shoot to? The forum is not alowing me to paste or attach it.

My email is gdecuir777@verizon.net Also, if you need to log into my site let me know.

Thanks,
gary
David ToUser is Offline
river guide
river guide
Posts:2736
Avatar

--
06-16-2009 12:23 PM
HI Gary, after logging in and checking our your webpage, I finally found out what the problem is. In your DR form, you do not have a shortname of "allcerts" anywhere. Hence, when you are passing it to the stored procedure, it's value is actually $(allcerts). Hence, if you look carefully at the stored procedure:

If (@allcerts = '') set @allcertsVar = (@cert + ' , ' + @certother) else set @allcertsVar = @allcerts

@allcertsVar will always be $(allcerts) and this would not work the way it supposed to work. You need to create a field with shortname of "allcerts" in your form somewhere. Note that it cannot be a Text / HTML field since this field cannot be passed their value. -- David
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-17-2009 09:31 AM
Hi David,

I thought because I had a DNN Core user profile field "allcerts" it wasn't needed in the DS form. I thought it would pass the stored procedure to the DNN Core field.

Now I understand. I created a field with the shortname "allcerts" on the DS form. However, the field still didn't update.

The filed is a Singleline textbox (long)

Thanks,
Gary
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-18-2009 09:36 AM
Hi David/Chad

Chad per our conversation, here is the message from the host/sql query.

System.Data.SqlClient.SqlException: Could not find stored procedure 'usp_certinsert'. 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 DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) usp_certinsert 1,'','MCTS,BCPIP,PMP,SAS', 'MPS'
gdecuirUser is Offline
river guide
river guide
Posts:71
Avatar

--
06-18-2009 10:03 AM
System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'LastUpdatedDate', table 'C7917_gpct.dbo.UserProfile'; column does not allow nulls. INSERT fails. The statement has been terminated. 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 DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) usp_certsinsert 1,'','MCTS,BCPIP,SAS,RHCE', 'test'
David ToUser is Offline
river guide
river guide
Posts:2736
Avatar

--
06-18-2009 10:19 AM
Okay, in the store procedure I posted earlier, I left out the "LastUpdatedDate" column which cannot be left empty. Here's the final store procedure that does work with the "LastUpdatedDate" included:

create procedure usp_certsinsert(@userid int, @allcerts nvarchar(500),@cert nvarchar(50),@certother nvarchar(50))
as
begin
declare @allcertsVar nvarchar(500)
If (@allcerts = '') set @allcertsVar = (@cert + ' , ' + @certother) else set @allcertsVar = @allcerts
declare @allcertsID int
set @allcertsID = (select PropertyDefinitionID from ProfilePropertyDefinition where PropertyName = 'allcerts')

-- if record doesn't exist, insert a new record
if not exists(select userid from UserProfile where userid = @UserID and PropertyDefinitionID = @allcertsID)
begin
insert into UserProfile(UserID,PropertyDefinitionID,PropertyValue,Visibility,LastUpdatedDate) values(@UserID,@allcertsID,@allcertsVar,2,getdate())
end
else
-- record exists, update it instead
begin
update UserProfile set PropertyValue = @allcertsVar, LastUpdatedDate = getdate()

where UserId = @UserID and PropertyDefinitionID = @allcertsID

end

end
Thomas BornUser is Offline
going with the flow
going with the flow
Posts:77
Avatar

--
06-30-2009 03:34 AM
It is almost working, I believe I discovered a bug in Dynamic Registration, please check the tickets in Snowcovered. I would love to get some feedback on this in the morning (Australian time)

Thanks
Thomas
You are not authorized to post a reply.
Page 2 of 2 << < 12


 
 

Join our mailing list...

Get current news and events the easy way

 

 

   
Subscribe Me

Recent Blogs...

 
Copyright 2005 - 2011 by Data Springs, Inc.