MyMovieCollection Starter Kit

Gday All,

I just downloaded the amazon enabled version of this starter kit and been looking over it but when i run it all is fine including the search online function but wen i try to add the highlighted result to my collection i get the follow prompt

'There was a problem adding this to the DVD collection'

and in the debug window i get this. I'm rather new to VB and .net so any help would be great.

"ID column is changing to proposed value 388f352d-0435-4282-b6b7-b2a42ae9a17c. The current value is 388f352d-0435-4282-b6b7-b2a42ae9a17c and row state is Detached.

Title column is changing to proposed value [New row - select to enter details]. The current value is [New row - select to enter details] and row state is Detached.

Title column is changing to proposed value The Goonies. The current value is The Goonies and row state is Detached.

Actors column is changing to proposed value Sean Astin;Josh Brolin. The current value is Sean Astin;Josh Brolin and row state is Detached.

Director column is changing to proposed value Richard Donner. The current value is Richard Donner and row state is Detached.

Rated column is changing to proposed value PG (Parental Guidance Suggested). The current value is PG (Parental Guidance Suggested) and row state is Detached.

YearReleased column is changing to proposed value 1985. The current value is 1985 and row state is Detached.

UPC column is changing to proposed value B00005J6UP. The current value is B00005J6UP and row state is Detached.

ImageLink column is changing to proposed value http://images.amazon.com/images/P/B00005J6UP.01._SCLZZZZZZZ_.jpg. The current value is http://images.amazon.com/images/P/B00005J6UP.01._SCLZZZZZZZ_.jpg and row state is Detached.

WebPageLink column is changing to proposed value http://www.amazon.com/exec/obidos/redirect?tag=ws%26link_code=sp1%26camp=2025%26creative=165953%26path=http://www.amazon.com/gp/redirect.html%253fASIN=B00005J6UP%2526tag=ws%2526lcode=sp1%2526cID=2025%2526ccmID=165953%2526location=/o/ASIN/B00005J6UP%25253FSubscriptionId=0525E2PQ81DD7ZTWTK82. The current value is http://www.amazon.com/exec/obidos/redirect?tag=ws%26link_code=sp1%26camp=2025%26creative=165953%26path=http://www.amazon.com/gp/redirect.html%253fASIN=B00005J6UP%2526tag=ws%2526lcode=sp1%2526cID=2025%2526ccmID=165953%2526location=/o/ASIN/B00005J6UP%25253FSubscriptionId=0525E2PQ81DD7ZTWTK82 and row state is Detached.

Description column is changing to proposed value You may be surprised to discover that the director of the Lethal Weapon movies and scary horror flick The Omen, Richard Donner, also produced and directed this classic children's adventure (which, by the way, was written by Donner's screen-wizard friend Steven Spielberg). Then again you may not. The Goonies, like Donner's other movies, is the same story of good versus evil. It has its share of bad guys (the Fratelli brothers and their villainous mother), reluctant-hero good guys (the Walsh bothers and their gang of friends), and lots of corny one-liners. Like in an old-fashioned Hardy Boys or Nancy Drew plot, the Goonies need to solve a problem: a corrupt corporate developer has bought out their neighborhood and plans to flatten all their homes. Luckily, the beloved gang stumbles on a treasure map. In the hopes of finding the treasure to buy back their houses, the Goonies embark on their quest through underground passages, aboard pirate ships, and behind waterfa

lls. This swashbuckling and rollicking ride was also a great breeding ground for a couple of child actors who went on to enjoy numerous successes in adulthood: Sean Astin (Rudy, Encino Man) and Martha Plimpton (Pecker, 200 Cigarettes). --Samantha Allen Storey . The current value is You may be surprised to discover that the director of the Lethal Weapon movies and scary horror flick The Omen, Richard Donner, also produced and directed this classic children's adventure (which, by the way, was written by Donner's screen-wizard friend Steven Spielberg). Then again you may not. The Goonies, like Donner's other movies, is the same story of good versus evil. It has its share of bad guys (the Fratelli brothers and their villainous mother), reluctant-hero good guys (the Walsh bothers and their gang of friends), and lots of corny one-liners. Like in an old-fashioned Hardy Boys or Nancy Drew plot, the Goonies need to solve a problem: a corrupt corporate developer has bought out their neighborhood and plans to flatten al

l their homes. Luckily, the beloved gang stumbles on a treasure map. In the hopes of finding the treasure to buy back their houses, the Goonies embark on their quest through underground passages, aboard pirate ships, and behind waterfalls. This swashbuckling and rollicking ride was also a great breeding ground for a couple of child actors who went on to enjoy numerous successes in adulthood: Sean Astin (Rudy, Encino Man) and Martha Plimpton (Pecker, 200 Cigarettes). --Samantha Allen Storey and row state is Detached.

MyRating column is changing to proposed value -1. The current value is -1 and row state is Detached.

Comments column is changing to proposed value . The current value is and row state is Detached.

Genre column is changing to proposed value . The current value is and row state is Detached.

Length column is changing to proposed value 90. The current value is 90 and row state is Detached.

ImageBinary column is changing to proposed value System.Byte[]. The current value is System.Byte[] and row state is Detached.

A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll

DefaultSource Error: 2 : Cannot set column 'WebPageLink'. The value violates the MaxLength limit of this column."
Thanks in advance.

[6941 byte] By [Mat007] at [2007-12-16]
# 1
anyone know what this might be ?
Mat007 at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 2
Hi MatDoubleohseven,
Yes, I know what the problem is, but I haven't found the solution yet. The URL you received from the web service that shows how to get the link for the movie (so you can watch it if you want), is too long (because it contains lengthy queries, etc) for the value of the WebPageLink field in your DVDs table. That field is declared nvchar(256) and the Web URL exceeds that in length. You can open the Database explorer (View|DatabaseExplorer) doubleclick the DVDCollectionDatabase.mdf, then expand tables, right click the DVDs table, select Open Table Definition, right click WebPageLink field, then select properties and try to set the value of nvchar(256) to nvchar(nnnn).

However, I have tried setting it to 1024 with the same problem. I'm not sure what the limit of nvchar can be.

In other words, I'm having the same problem. So if you get a solution, I'd be much obliged! If I'm right about the problem, then at least we're starting at the same starting point on finding an answer and two heads are better than one.
Phil

pberkhof at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 3
I can't even get the MovieCollection starter kit to save records that I add.

Do the movies you guys are adding get saved in the SQL Express database?

worldstomp at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 4
The Limit is 4000.

Tried changing to the max. Didnt work.

Its just unbelievable the "press" this amazon addition has recieved...and it doesnt work!

very sad.

cablehead at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 5
Antoine has added an entry in the SmartClientData blog about the "missing" data in SQL express here:

http://blogs.msdn.com/smartclientdata/archive/2005/08/26/456886.aspx

Check out the "Where is my data? -- Understanding the file copy for desktop projects" section... This may explain where your data went...

The max length of the URL returned by the web service has indeed changed as pberkhof mentions above. The samples have been updated and will work in the "real" (non-beta) version.

Cablehead, what is it that doesn't work for you when you change the value? Where did you change the value?

Best regards,
Johan Stenberg

JohanStenberg at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 6
I changed the value as pberkhof described above.
cablehead at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 7
I don't have an old version of the starter kit available, but I believe that you may have to change the length both in the database (as described above) as well as in the DVDCollectionDataset xsd file.

Best regards,
Johan Stenberg

JohanStenberg at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 8
Changed them both...no go....
cablehead at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 9

Hi Mat007,


Glad to hear that you are using the Movie Collection starter kit. I’m sorry that you are experiencing this problem. I've listed some instructions below to get your app up and running again, so that you can get back to building up your collection :).

The reason you are getting this error when adding an online search result to your collection, is because the app is trying to save web addresses into database fields which are too small. The URLs which get returned from Amazon's web services have since increased in length, so that is why this problem started happening. The way to fix the problem is to increase the size of this column in the database. The current data type for this column is nvarchar(255). To allow maximum flexibility going forward, I suggest changing this type to nvarchar(max). With this change, the new data type will hold a maximum of 2147483647 characters instead of the original 255. (Note that this is the data type already being used in the app for the Comments and Description fields...)

If you already have an app that you created from the Beta2 Movie Collection Starter Kit, then here are the steps you need to make this fix:

1) Update the database schema:

a. Go to View->Server Explorer to open Server Explorer.

b. Expand the node for DVDCollectionDatabase.mdf

c. Expand the “Tables” node.

d. Double-click on the “DVDs” node.

e. Look for the two column names: ImageLink and WebPageLink. Both will currently have an associated Data Type of nvarchar(255).

f. In both cells, change the associated Data Type to nvarchar(MAX). You can either do this by typing directly into the cell, or by selecting nvarchar(MAX) from the dropdown which appears when you click on the cell.

g. Save the .mdf file.

2) Update the dataset:

a. In Solution Explorer, double-click on DVDCollectionDataSet.xsd. The file will open, displaying the DVDs dataset.

b. Click on the ImageLink field. In the properties window, type 2147483647 into the MaxLength field, which previously read 255.

c. Now, scroll down in the DVDs dataset and click on WebPageLink. Do the same as above (changing the MaxLength property from 255 to 2147483647).

d. Finally, to get these dataset changes propagated to the designer-generated files, right-click on DVDCollectionDataSet.xsd in Solution Explorer, and select “Run Custom Tool”.

1. Note: an alternative way to do this last step is to click on the “Show All Files” icon in Solution Explorer, and replace the following two lines in the InitClass() sub of the DVDsDataTable class. (These start out at line numbers 478 & 479 in a new Movie Collection app):
Me.columnImageLink.MaxLength = 2147483647
Me.columnWebPageLink.MaxLength = 2147483647

Now you should be all set!

Enjoy the app,
Lisa Feigenbaum
VB Program Manager

LisaF at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 10
That did it! Was the ImageLink in my case.

How do I save this updated version as the template now?

cablehead at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 11
Hi cablehead,

Now that you have your project as you want it to appear, go to File -> Export Template. If you were working on the VB movie collection, and you kept the default location used in the wizard which creates the template, then you're new template will show up in the "My Templates" section of the "Visual Basic" node in the New Project dialog.

Happy coding,
Lisa

LisaF at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 12

Thank You Lisa, This fixed my problem. I am kicking myself now though as I had changed the char length to MAX but not in the XSD file :( Ah well its working now.

Mat

Mat007 at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 13
Hello all,

if you do not want to touch the database you could adjust the function

DVDsRowFromDVDObject

Just replace the line

.WebPageLink = myDvd.WebPageUrl

with

If Len(myDvd.WebPageUrl) <= 255 Then

.WebPageLink = myDvd.WebPageUrl

Else

.WebPageLink = Left(myDvd.WebPageUrl, 200) & "...."

End If

Maybe not as fantastic as changing the database but it works ...

Greetings Danny.

Steentje at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 14

I have downloaded the Amazon web enabled starter kit and tested it and it works great for me no problems at all on My end I am also new to VB.net 2005 I have used vb 6 and vb.net 2003 standard

PS..... hello everyone ;)

VBgirl at 2007-9-9 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...