When configuring a SqlDataSource control in an ASP.NET webpage, after creating a Connection string, on the "Configure the Select Statement"
page, with a database table selected and columns clicked, clicking the Advanced button did not display the boxes for generating the 'Additional
INSERT, UPDATE, and DELETE statements. Why?
I have had this problem before and the problems seemed to related to the creating a Primary Key of table. However, working a new website,
I found out I had no problem with a table without a PK, while for a table with a PK, the Advanced Insert/Update/Delete statement can not be
generated. Why?
When configuring a SqlDataSource control in an ASP.NET webpage, after creating a Connection string, on the "Configure the Select Statement"
page, with a database table selected and columns clicked, clicking the Advanced button did not display the boxes for generating the 'Additional
INSERT, UPDATE, and DELETE statements. Why?
According to your description, do you mean that vs couldn’t display the boxes for generating the 'Additional
INSERT, UPDATE, and DELETE statements' when the table with a primary key? If so, I create a demo which has a table with primary key, and I don’t encounter the issue what you occurring.
Firstly, I select some field without primary key. The option is disabled.
Secondly, as it said, you must have all primary key fields selected for this option to enabled, I select the primary key field, it’s to be enabled.
wonjartran
I have had this problem before and the problems seemed to related to the creating a Primary Key of table. However, working a new website,
I found out I had no problem with a table without a PK, while for a table with a PK, the Advanced Insert/Update/Delete statement can not be
generated. Why?
Thirdly, I create a table without primary key. It’s disabled whatever I select any field.
Member
249 Points
1369 Posts
Why the Advanced Insert/Update/Delete statement for a SQL DataSource can not be generated?
Mar 29, 2016 08:13 PM|wonjartran|LINK
When configuring a SqlDataSource control in an ASP.NET webpage, after creating a Connection string, on the "Configure the Select Statement"
page, with a database table selected and columns clicked, clicking the Advanced button did not display the boxes for generating the 'Additional
INSERT, UPDATE, and DELETE statements. Why?
I have had this problem before and the problems seemed to related to the creating a Primary Key of table. However, working a new website,
I found out I had no problem with a table without a PK, while for a table with a PK, the Advanced Insert/Update/Delete statement can not be
generated. Why?
Thanks in advance,
Jeffrey
All-Star
187702 Points
27196 Posts
Moderator
Re: Why the Advanced Insert/Update/Delete statement for a SQL DataSource can not be generated?
Mar 30, 2016 07:08 AM|Mikesdotnetting|LINK
You need to make sure that the PK is part of the SELECT statement. Then the other operations should become available.
ASP.NET Tutorials | Learn Entity Framework Core | Learn Razor Pages
Contributor
2570 Points
501 Posts
Re: Why the Advanced Insert/Update/Delete statement for a SQL DataSource can not be generated?
Mar 30, 2016 07:08 AM|Cole Wu|LINK
Hi wonjartran,
According to your description, do you mean that vs couldn’t display the boxes for generating the 'Additional
INSERT, UPDATE, and DELETE statements' when the table with a primary key? If so, I create a demo which has a table with primary key, and I don’t encounter the issue what you occurring.
Firstly, I select some field without primary key. The option is disabled.
Secondly, as it said, you must have all primary key fields selected for this option to enabled, I select the primary key field, it’s to be enabled.
Thirdly, I create a table without primary key. It’s disabled whatever I select any field.
Best regards,
Cole Wu