CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Datagrid

  1. #1
    Join Date
    Jun 2001
    Posts
    10

    Datagrid

    hi ,
    is it possible to add multiple records in a datagrid at runtime...if so....how?


  2. #2
    Join Date
    May 2001
    Location
    India, Bangalore
    Posts
    14

    Re: Datagrid

    Hi Narmada Gosula,

    Yes we can add multiple records to datagrid at runtime.. (I think following code may help you)

    -------------------------------------------------

    Option Explicit
    Dim objRs As New ADODB.Recordset

    Private Sub Command1_Click()
    Set DataGrid1.DataSource = objRs
    DataGrid1.Refresh
    End Sub

    Private Sub Form_Load()
    objRs.ActiveConnection = "DSN=DSNname;UID=UserName;PWD=Password;"
    objRs.LockType = adLockOptimistic
    objRs.CursorType = adOpenStatic
    objRs.Open "Select * from TableName", , , , adCmdText
    End Sub

    'bpp



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

Featured