Monday 20 August 2012

How to bind data to Datagrid or Gridview in vb.net using DataBind()

How to bind data to Datagrid or Gridview  in vb.net  using DataBind()
 Private Sub Page_Load(....) Handles MyBase.Load
        'Put user code to initialize the page here
            Dim con As New SqlClient.SqlConnection("Data Source=SERVER;Initial Catalog=ERP;Integrated Security=True")
        Dim com As New SqlClient.SqlCommand
        Dim ds As New DataSet
        Dim da As New SqlDataAdapter
        da = New SqlDataAdapter("select scode,fname,prod1,prod2,prod3,prod4 from Supplier_Master", con)
        da.Fill(ds, "Stock")
            dgsupp.DataSource = ds.Tables("Stock")
        dgsupp.DataBind()
    End Sub
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: