Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Mada Akhtar   on Oct 19 In Asp.net Category.

  
Question Answered By: Beverly Brooks   on Oct 19

Sorry for not supplying any information. You are suppose to know what I am doing. Right?

Heres some code that I use to populate  my datagrid. I am also using VB. Think this will be enough to give  you an idea of what I am doing. Thanks.


Sub Page_Load(Src As Object, E As EventArgs)
Dim ConnectString As String
MyConnect = New SqlConnection
connectString = ConfigurationSettings.AppSettings("ConnectStr")
MyConnect.ConnectionString = ConnectString
If Not IsPostBack Then
BindGrid()
End If
End Sub

public Sub BindGrid()
Dim MyCommand As SqlDataAdapter = New SqlDataAdapter ("Select * " _
& "From Users", MyConnect)
Dim ds As DataSet = New DataSet()
MyCommand.Fill(ds)
MyDataGrid.DataSource=ds
MyDataGrid.DataBind()
End Sub

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Datagrid Or get search suggestion and latest updates.


Tagged: