GridView in ASP.NET 2.0

Posted by Subho on Stack Overflow See other posts from Stack Overflow or by Subho
Published on 2009-04-18T13:56:32Z Indexed on 2010/05/05 3:08 UTC
Read the original article Hit count: 248

How can I populate an editable Grid with data from different tables from MSSQL Server'05 writing a code behind function???

I have used:

    Dim conn As New SqlConnection(conn_web)
    Dim objCmd As New SqlDataAdapter(sql, conn)
    Dim oDS As New DataSet

    objCmd.Fill(oDS, "TAB")

    Dim dt As DataTable = oDS.Tables(0)
    Dim rowCount As Integer = dt.Rows.Count
    Dim dr As DataRow = dt.NewRow()
    If rowCount = 0 Then
        e.DataSource = Nothing
        e.DataBind()
        e.Focus()

    Else
        e.DataSource = dt
        e.DataBind()
    End If

© Stack Overflow or respective owner

Related posts about asp.net-2.0

Related posts about gridview