首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

有关问题!

2012-01-07 
问题求助!!!ProtectedSubGridView1_RowUpdating(ByValsenderAsObject,ByValeAsSystem.Web.UI.WebControls.

问题求助!!!
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)
...
...

热点排行