问题描述
我创建了一个表名TestA,其中只有一个名为C1 nchar(10)的列,而不是主键.
我将DetailsView拖放到窗体上,然后启用该控件的分页,插入,更新.
将一个按钮添加到EmptyDataTemplate,以将DetailsView模式更改为插入".运行此页面,一切正常. (同时测试SqlDataSource和ObjectDataSource)
I had create a table name TestA with only one column named C1 nchar(10) not null primary key.
I drag and drop a DetailsView on the form, then enable this control's paging, inserting, updating.
Add a button to EmptyDataTemplate for changing the DetailsView Mode to Insert. Run this page, everything works fine. (test both SqlDataSource & ObjectDataSource)
然后,我创建一个名为TableA的新表,其中只有一个名为C1 uniqueidentifier的列,而不是空主键.
重做以上所有内容后,使用SqlDataSource我必须手动更改delete和insert参数,如:
then I create a new table named TableA with only one column named C1 uniqueidentifier not null primary key.
after redo everything above, using SqlDataSource I have to change delete and insert parameter manually like :
< asp:参数名称="C1"类型=空". />
<asp:Parameter Name="C1" Type="Empty" />
使用ObjectDataSource得到的结果更糟.不断告诉错误:由ObjectDataSource'C1''''
using ObjectDataSource got worse result. Keep telling error : InvalidOperationException on the type specified by the DataObjectTypeName property in ObjectDataSource 'C1'"
任何反馈将不胜感激.
顺便说一句,我使用Visual Studio .net 2008
any feedback will be appreciated.
BTW, I use visual studio .net 2008
推荐答案
对于与ASP.NET相关的Web开发问题,我们建议您在ASP.NET论坛中提出来,以获得那里的相关专家的更快更好的答复.
For ASP.NET related web development questions, we suggest you raise it in the ASP.NET forums to get better and quicker replies from the related experts there,
最诚挚的问候,
纪周
论坛中的MSDN订阅者支持
Best regards,
Ji Zhou
MSDN Subscriber Support in Forum
这篇关于详细信息查看Bug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!