CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 GUID in Link of URL of Activation Email to update status in DB

Print topic Send  topic

Author Message
andash


Posts: 18
Posted: 01/10/2008, 12:09 AM

Can anyone shed some light on this problem for me?
VB.net, CCS 3.99, .net2.0, IIS, MS-SQL 2005:
I have a registration page that creates a GUID using a Variable System.Guid.NewGuid().ToString() that works great. It inserts this in to the guid field in the users table and sends the email with that as part of the activate link in the email.
Next I have built a page that this link refers to where I have added a "before show" action that should update the user status field where the Table Users.Guid = the Guid in the URL( a declared variable). Simple!.

However I'm not sure how to format the Guid Variablename correctly to include it in the SQL update statement. It needs to be contained by ' ' as it is a text feld.

Current code is:

Dim Request As HttpRequest = HttpContext.Current.Request
Dim NewDao As DataAccessObject = Settings.SQLServerDataAccessObject
Dim Sql As String = "UPDATE users SET Status = 'Y' WHERE guid = 'VariableName' "
NewDao.RunSql(Sql)

I can make the code work when I manually replace the variable name with an actual value so I know the basic code is working, also in another label I am displaying the variable so I know it is retrieving the value from the URL OK

thanks in advance
_________________
Andrew Asher
www.it3.co.nz
View profile  Send private message
andash


Posts: 18
Posted: 01/14/2008, 5:31 PM

Thanks to PeterR from Support: :-) this is the solution.

Dim Request As HttpRequest = HttpContext.Current.Request
Dim NewDao As DataAccessObject = Settings.SQLServerDataAccessObject
Dim Sql As String = "UPDATE users SET Status = 'Y' WHERE guid = '"& VariableName &"' "
NewDao.RunSql(Sql)


_________________
Andrew Asher
www.it3.co.nz
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.