944,083 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 6158
  • ASP.NET RSS
Apr 25th, 2007
0

Problem Inserting into SQL database on server

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
someoneelse is offline Offline
14 posts
since Mar 2007
Apr 25th, 2007
0

Re: Problem Inserting into SQL database on server

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.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Apr 26th, 2007
0

Re: Problem Inserting into SQL database on server

THANK YOU SO MUCH!

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

~ Andrea
Reputation Points: 10
Solved Threads: 0
Newbie Poster
someoneelse is offline Offline
14 posts
since Mar 2007
Apr 26th, 2007
0

Re: Problem Inserting into SQL database on server

I know! I've been there too many times
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: help for auto complete text box
Next Thread in ASP.NET Forum Timeline: datagrid hyperlink





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC