Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2007, 01:24 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What is the datatype of PostedBy in the database?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old May 9th, 2007, 06:14 AM
Registered User
 
Join Date: May 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

The Datatype is nvarchar MAX

 
Old May 9th, 2007, 06:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:This code also assumes you have a column called PostedBy which holds the Guid of the user that posted the Blog entry.
Quote:
quote:Dim posterId As Guid = CType(myDataRowView("PostedBy"), Guid)
Quote:
quote:The Datatype is nvarchar MAX
Doesn't this give you a clue?

The dat type in the database doesn't match the one in the ASPX page. ProviderUserKey is a Guid so you should store it as a Guid (a Uniqueidentifier) in the database.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old May 10th, 2007, 09:20 PM
Registered User
 
Join Date: May 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Imar,

I have another question. I've edited all the necessary things in the database and page. but i'm having trouble with this line in the Edit Command:

 Dim postedBy As Guid = Convert.(e.CommandArgument)

I can't figure out how to convert the Guid. Its undet the BlogEntyries.vb

 
Old May 11th, 2007, 04:12 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can't "convert" a string to a Guid, you'll need to create a new one based on the string. E.g.:

Dim myGuid As Guid = New Guid(SomeString)

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old May 14th, 2007, 08:09 AM
Registered User
 
Join Date: May 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

What do I put in the place of (SomeString)



 
Old May 14th, 2007, 04:08 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hmmm, isn't that obvious from the previous discussion?

What does Visual Web Developer's IntelliSense tell you when you press the ( for New Guid( ??

The constructor for the Guid expects a string that *looks like* a Guid, so it can create a new one based on that.

In your case, isn't it obvious what you need to pass and isn't it what you almost posted in your previous message? What is it that you're trying to *convert* to a Guid? I'd say it's e.CommandArgument which should hold the Guid from the database, converted as a string....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrox Blog in C# madAlan BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 22 June 12th, 2011 04:09 AM
Wrox Blog: Viewing individual blog entries Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 May 7th, 2007 12:06 PM
Login for Wrox Blog danielson BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 March 20th, 2007 02:12 PM
Wrox blog suggestions nakori BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 June 15th, 2006 04:35 PM
Wrox Blog Admin addstravel BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 April 23rd, 2006 05:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.