【发布时间】:2009-06-02 21:03:19
【问题描述】:
1) 当SqlParameter.IsNullable 设置为true 时,接收到的null 值转换为DBNull.Value 并发送到数据库。因此我假设将IsNullable 设置为true 仅在GridView 的Parameter.ConvertEmptyStringToNull 也设置为true 时才有意义?
2) GridView 和 ObjectDataSource 的参数都有一个ConvertEmptyStringToNull 属性。但是是否有过这种情况(尝试更新数据源时):
• 我们应该将GridView 的Parameter.ConvertEmptyStringToNull 设置为true,然后将ObjectDataSource 的Parameter.ConvertEmptyStringToNull 设置为false?!
• 或者我们应该将 GridView 的Parameter.ConvertEmptyStringToNull 设置为true,但将SqlDataSource 的SqlParameter.IsNullable 设置为false?
【问题讨论】:
标签: c# .net asp.net gridview objectdatasource