Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old May 9th, 2007, 01:24 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #12 (permalink)  
Old May 9th, 2007, 06:14 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

The Datatype is nvarchar MAX

  #13 (permalink)  
Old May 9th, 2007, 06:46 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #14 (permalink)  
Old May 10th, 2007, 09:20 PM
Registered User
 
Join Date: May 2007
Location: , , .
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

  #15 (permalink)  
Old May 11th, 2007, 04:12 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #16 (permalink)  
Old May 14th, 2007, 08:09 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

What do I put in the place of (SomeString)



  #17 (permalink)  
Old May 14th, 2007, 04:08 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.