如何用 AccessDataSource 里的数据复值到 DataSet里 因为我想从AccessDataSource读取数据,因为只有先把数据复值到 DataSet里才能从 DataSet读取数据!请高手告知,谢谢!

解决方案 »

  1.   

    ACCESSdatasource???
     从ACCESS数据库读的数据?
      

  2.   

    <add key="ConnectionForKaoQin" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=E:\\石壁水库\\中控\\att2000.mdb"/>Data Source后面跟的是你ACCESS数据库的路径。//链接
    string strConnection =
            ConfigurationSettings.AppSettings["ConnectionForKaoQin"];objConnection = new OleDbConnection(strConnection);其他做法跟我们平时对SQL数据库的操作一样
      

  3.   

    要加上这个
    using System.Data.OleDb;
      

  4.   

    to cai3725 
    难道不能直接用 AccessDataSource 控件来操作然后把返回数据级再赋值到DataSet里然后对DataSet进行操作吗?
      

  5.   

    有没有直接用 AccessDataSource 控件来操作然后把返回数据级再赋值到DataSet里然后对DataSet进行操作的方法!在线等待急......
      

  6.   

    有没有直接用 AccessDataSource 控件来操作然后把返回数据级再赋值到DataSet里然后对DataSet进行操作的方法!在线等待急......
      

  7.   

    我也在找这个只要能得到只要AccessDataSource中的数据就好随便是dataset dataview datatable
      

  8.   

    实在不对用这个方法吧.sSql = vbNullString
    sSql = sSql & " select [UserID] "
    sSql = sSql & "       ,[Name] "
    sSql = sSql & "   from [User] "
    sSql = sSql & "  where [Leader] = no "
    AccDataS.SelectCommand = sSql                //sql语句Dim GV As GridView = New GridView
    GV.DataSource = AccDataS
    GV.DataBind()                              //绑定到 gridviewFor i As Integer = 0 To GV.Rows.Count - 1
       DropDUserID.Items.Add(GV.Rows(i).Cells(0).Text.Trim().ToString)
       DropDUserID.Items(DropDUserID.Items.Count - 1).Text = GV.Rows(i).Cells(0).Text.Trim().ToString
       DropDUserID.Items(DropDUserID.Items.Count - 1).Value = GV.Rows(i).Cells(1).Text.Trim().ToString
    Next i