none
ADODB connection RRS feed

  • Question

  •  CN2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Trim$(MitsSetUpFile.MainDataLocation) & "\" & MDBName
    

    can I use the CN2 to load a datagrid using a data adapter or another method?

    if so, could someone please provide some code?

     

    Monday, October 11, 2010 9:21 PM

Answers

  • I think you wanted to say OleDb connection, not ADODB. Sure you can, one way is to populate a DataSet using a DataAdapter (which in turn uses connection instance).

    http://msdn.microsoft.com/en-us/library/bh8kx08z.aspx

    or in case of ASP.NET's DataGrid you could use a DataReader which might be a bit more efficient

    http://www.c-sharpcorner.com/UploadFile/Ashish1/ReaderClass10292005111908AM/ReaderClass.aspx


    Miha Markic [MVP C#] http://blog.rthand.com
    • Marked as answer by RockinRon399 Tuesday, October 12, 2010 1:14 PM
    Tuesday, October 12, 2010 6:30 AM