问题求助!!!
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
For Each valueEntry As DictionaryEntry In CType(e.NewValues, IEnumerable)
If ((valueEntry.Key.ToString = "BT ") And (valueEntry.Value.ToString().IndexOf( ", ") > 0)) Then
e.Cancel = True
Label1.Text = "输入错误!! "
End If
Next valueEntry
End Sub
If ((valueEntry.Key.ToString = "BT ") And (valueEntry.Value.ToString().IndexOf( ", ") > 0)) Then这一行说使用 "new "关健字创建对象实例是什么意思???????
[解决办法]
valueEntry 没有实例,在使用前创建
试试这样?我没启动VS,没调试,你看看先
Dim valueEntry As DictionaryEntry = new DictionaryEntry()
For Each valueEntry In CType(e.NewValues, IEnumerable)
...
...