Results 1 to 2 of 2

Thread: Grid view help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    260

    Grid view help

    Dear Friends

    I am making an application in which a gridview take a parameter from textbox to populate a data. my question is how can i make it display in running. i mean i want when i click a button. the gridview should display the data filtered on the basis of textbox. and i should be able to select the rows too. the code i have done so far is like this. it shows the data but it do not allow me to select the data


    Code:
    Sub populate_Grid()
            'This code is used to populate the data
            Try
    
                Dim sql_connection As New SqlConnection("Data Source=cc;Initial Catalog=Raw_dspatch;User ID=xxx;Password=fff")
                Dim sql_command As New SqlCommand("SELECT PO_No, Srno, Item_Code, Detail, Order_Qty, Rate FROM ER_Purchase_Order WHERE PO_No = '" & txtPo_no.Text & "'", sql_connection)
                Dim da As New SqlDataAdapter(sql_command)
                Dim dt As New DataTable
                da.Fill(dt)
                GridView1.DataSource = dt
                GridView1.DataBind()
    
    
    
    
    
    
    
    
    
    
            Catch ex As Exception
                MsgBox(ex.ToString)
    
            End Try
        End Sub

    Please help me. its urgent

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

    Re: Grid view help

    Sample code given here: http://aspadvice.com/blogs/joteke/ar.../07/14576.aspx

    (To let you select a row)

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