Results 1 to 3 of 3

Thread: Select Button at the datagrid

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    33

    Select Button at the datagrid

    i having a datagrid which having a button Named select... it is select the row data and store into another table. Below is my code but it cant run.. Can anyone help me?
    Code:
     
    Private Sub details_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles details.ItemCommand
    
            Dim sqlstr3 As String
            Connect()
            sqlstr3 = "Insert Into AssetMovement (Ass_Code, Ass_Category,Ass_Status,CheckInDate,CheckOutDate,ExpiryDate)" & _
                      "VALUES ('" & e.Item.Cells(1).Text() & "','" & e.Item.Cells(3).Text() & "','" & e.Item.Cells(8).Text() & "','" & DateTime.Now & "',' ','','" & "'30days')"
    
    
            If (e.CommandName = "Select") Then
                RunQuery(sqlstr3)
                hidMsg.Value = "S"
                Dps()
            End If
            Response.Redirect("frmAssetMovementList.aspx")
    
        End Sub

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Location
    Cleveland, Ohio
    Posts
    185

    Re: Select Button at the datagrid

    Are you getting some kind of error when you try to run the code? If so, could you put the error out here...that might help a little bit more.

    Jim P.
    "The Force will be with you, always."

    --Ben Kenobi--

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Select Button at the datagrid

    Step through your code, when the debugger reaches sqlstr3, get its value and try running it in Query Analyzer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width