CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > starter_kits_and_source_projects.personal_site_starter_kit Tags:
Item Type: Date Entered: 12/5/2007 4:45:40 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 38 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"djclothier" <>
NewsGroup User
Photo Album woes..12/5/2007 4:45:40 PM

0

Hi all,

I've hit a snag that I can't seem to find the solution for - maybe one of you has come across this before and can help me out?

I've moved my Personal Web Site from SQLExpress into SQL 2005, and the tables look like they are set up correctly - the primary keys are there, as are the table structures etc, but I now get this error if I try and create a new album:

 

Cannot insert the value NULL into column 'AlbumID', table 'Personal.dbo.Albums'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'AlbumID', table 'Personal.dbo.Albums'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Source Error:

 

Line 161:				command.Parameters.Add(New SqlParameter("@IsPublic", IsPublic))
Line 162: connection.Open()
Line 163: command.ExecuteNonQuery()
Line 164: End Using
Line 165: End Using

 
This used to work before, but now doesn't - from what I can gather from this it seems to be trying to create an album with an ID of null, instead of the next sequential number in the list of Album ID's?

What's the best way of getting around this?

Incidentally I created an album manually (through SQL manager etc) to test this, et voila it works, but then when you try and load a photo into it the same error occurs, as Photo ID it's trying is null too.

Any idea why it's trying a null insert now where it wasn't before?

 
Thanks,

David
 


David Clothier



If this answers to your question, please mark it solved/answered.
"MaineOne" <>
NewsGroup User
Re: Photo Album woes..12/5/2007 8:47:02 PM

0

You should just need to make sure to set these fields on the AlbumID and PhotoID column properties.

Identity Specification = yes

(IsIdentity)=yes

Identity Increment =1

Identity Seed =1


[email protected]

"djclothier" <>
NewsGroup User
Re: Photo Album woes..12/5/2007 10:10:02 PM

0

Excellent, thanks!

Tried, tested and it works just fine.

Regards,

David
 


David Clothier



If this answers to your question, please mark it solved/answered.
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:













impersonation

file access

windows authentication problem

multiple dynamic membershipproviders

searching aspnet_profile

asp.net & classic asp authentication

custom profile provider for user information- sql table store

new user already exists?

adding info to formsauthentication ticket

using headers and a hidden folder to hide content

how to logoff programatically in membership?

security - can't create a user

windows authentication w/ active directory roles authorization

loginview control's viewchanged event does not fire

problem with a login

user roles

viewing encrypted documents using asp.net (windows server 2003)

users action log

symmetric encryption key storage

resources problem

very important, very urgent!!! aspencrypt related

minimal role management

updateuser method only updates email ... how to update other fields?

removing scripts from user input

membership not working

need some help with membership.

setting up user and roles

a problem about ip access control in iis

changing the application name dynamically

the best method of authentication.

troubleshooting impersonation with iis7 impersonation

membership and my own database tables

error in web site administration tool

how to save data at end of multi-step createuserwizard control?

how to use the aspnet_regsql.exe utility wizard to use an exisitng database to set membership, roles etc. on a shared server?

roles.getallroles using objectdatasource

roles in asp.net 2.0

should we store customer information (uid, pwd) on database or active directory?

windows authentication with roles in ad

moved membership to new database

iis active directory authentication problems

peristing information between wizardsteps.

where to store a private key?

unhackable link.

certificates

i authenticate my app by using forms but cannot get security from history in internet explorer

accessing controls in loginview

i’m trying to grant the asp.net identity read access to the default rsa key container i get the message: the rsa key container was not found. failed!

integrated windows authentication

simple question - need input

   
  Privacy | Contact Us
All Times Are GMT