depotposition 前面少一个逗号!

解决方案 »

  1.   

    MyCommand.Parameters.Add(New SqlParameter("@id", SqlDbType.BigInt, 8))是BIGINT型的,不能用。TEXT什么的,你要转化成INT型
      

  2.   

    估计这是DataGrid的itemCommand事件吧,避免e.Item.ItemIndex等于-1,因为翻页、排序等事件同样可以触发itemCommand
    Sub MyDataGrid_Update(sender As Object, e As DataGridCommandEventArgs)
    if e.Item.ItemIndex>-1 then
    ....
    end if
    end sub
      

  3.   

    MyCommand.Parameters("@id").Value = MyDataGrid.DataKeys(CInt(E.Item.ItemIndex))
    你的MyDataGrid.DataKeys()有没有这么多呀,你跟踪调试一下
      

  4.   

    Dim ds As New DataSet
    Cstring = "SELECT id,factory as col1,workorder as col2,FD as col3,FDDescribe as col4,FDQuantity as col5,"
    Cstring = Cstring + "line as col6,depot as col7,depotposition as col8,nc as col9,ncDescribe as col10,"
    Cstring = Cstring + "ncQuantity as col11,QtPerBk as col12,unit as col13,riqi as col14 from material"
    Dim da As SqlDataAdapter = New SQLDataAdapter(Cstring,Conn)
    da.fill(ds,"material")
    MyDataGrid.DataSource = ds.Tables("material").defaultview
    MyDataGrid.DataBind()
    Conn.Close()
    panel2.visible = true
    MyDataGrid.visible = true
    还有注意空格