Problem Inserting into SQL database on server

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2007
Posts: 14
Reputation: someoneelse is an unknown quantity at this point 
Solved Threads: 0
someoneelse someoneelse is offline Offline
Newbie Poster

Problem Inserting into SQL database on server

 
0
  #1
Apr 25th, 2007
I am using visual devloper express, and i have been following allow in the "starter videos". for lesson 8 (editing and insterting into a sql express db file on the local host), the example worked fine, but when i try to replicate the example with a SQL database (external one) when I am configuring the formView, and i try to click the advanced tab under 'Advanced SQL Generation Options", I do not have the abilty to check the 2 boxes for generate insert, update, delete statements, etc (they are greyed out).

i have an asp page that has the same connection as this page and i am able to insert a record, so i am sure it's not a permission thing...

does anyone else know how to solve this problem, or has it occured for someone else? I am at a loss....I don't understand what I am doing wrong here... a plain old asp coded page inserts records into this table in the same database, but I am unable to check the boxes for "generate insert" etrc, and the error I get on the page itself is

Inserting is not supported by data source 'SqlDataSource1' unless InsertCommand is specified.





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.NotSupportedException: Inserting is not supported by data source 'SqlDataSource1' unless InsertCommand is specified.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Problem Inserting into SQL database on server

 
0
  #2
Apr 25th, 2007
Did you set your id column as a primary key in the external database? This prevents the generate sql statements being available as it can't generate sql for tables that don't have a primary key.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 14
Reputation: someoneelse is an unknown quantity at this point 
Solved Threads: 0
someoneelse someoneelse is offline Offline
Newbie Poster

Re: Problem Inserting into SQL database on server

 
0
  #3
Apr 26th, 2007
THANK YOU SO MUCH!

I was going crazy and that solved my problem in less than 1 minute

~ Andrea
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Problem Inserting into SQL database on server

 
0
  #4
Apr 26th, 2007
I know! I've been there too many times
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC