2013-04-04 51 views
-1
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating 

    sqlqrystrng = "UPDATE temp_zone set zone_id = @zoneid, zone_name = @zonename WHERE auto_id = @autoid" 

    Dim lbl As Label = GridView1.Rows(e.RowIndex).Cells(0).FindControl("Label5") 
    Dim strautoid As String = lbl.Text 
End Sub 
+0

在其中的代碼行有一個例外

嘗試找到控制? – 2013-04-04 04:50:20

+0

請更具體的錯誤發生在哪條線.. – 2013-04-04 04:50:23

+0

需要更多細節。在此發佈完整的錯誤消息。 – viclim 2013-04-04 04:50:44

回答

0

的問題是在該行

Dim strautoid As String = lbl.Text 

因爲你在Label變量空值。在row而不是cell作爲

Dim lbl As Label = GridView1.Rows(e.RowIndex).FindControl("Label5") 
Dim strautoid As String = lbl.Text 
+0

是的問題是在Dim Strautoid作爲字符串= lbl.Text,我認爲即時通訊在編輯期間沒有在編輯期間使用Lable – 2013-04-04 04:55:29

+0

現在問題解決了,謝謝你幫助我...... – 2013-04-04 04:55:55

+0

請您好好標記答案如果它幫助你。 – 2013-04-04 05:08:50

相關問題