Results 1 to 3 of 3

Thread: recordsets in datagridview

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    recordsets in datagridview

    I am using VB.NET 2005, I have a datagridview that I want the user to be able to update with an ADO recordset .I could do this in Vb6 with datagrids, by setting the datasource, but not able to in VB NET. I see on the forums that it is recommended to use ADO.NET. But I really don't want to do anyting fancy here, is there not a way to do this? simply without learning something new each time..


    CN = New ADODB.Connection
    RS_Stations = New ADODB.Recordset
    CN = Globals.Connect_Database

    RS_Stations.Open("SELECT * FROM Stations", CN, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
    DG_Stations.DataSource = RS_Stations

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: recordsets in datagridview

    If you're developing in VB.NET then you need to learn ADO.NET, plain and simple. If you're not doing anything fancy then now is the perfect time to start. This will only take a you a few lines of code.

    http://www.vbforums.com/showthread.php?t=469872
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    Re: recordsets in datagridview

    THanks JM,
    THat set me on the right path. I really like ADO and you are right this is a perfect time to learn .Net with an simple task. It is sometimes hard to always be learning "new" on the job, for something due yesterday. Your post was very helpful.
    Thanks again

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