User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,194 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,156 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

Insert to multiple tables

Join Date: Feb 2008
Location: Va Beach
Posts: 179
Reputation: foundsheep is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
foundsheep's Avatar
foundsheep foundsheep is offline Offline
Junior Poster

Re: Insert to multiple tables

  #6  
Feb 15th, 2008
That fixed that but , there's always a but, I got this:

Object cannot be cast from DBNull to other types.
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.InvalidCastException: Object cannot be cast from DBNull to other types.

Source Error:

Line 70: cmd.ExecuteNonQuery()
Line 71: cmd = New SqlCommand("SELECT SCOPE_IDENTITY()", conn)
Line 72: Dim cusID As Integer = Convert.ToInt32(cmd.ExecuteScalar())
Line 73:
Line 74: cmd2.ExecuteNonQuery()

I'm getting some stupid error in SQL about not being able to let certain fields be null even though they really aren't.
Reply With Quote  
All times are GMT -4. The time now is 10:16 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC