DA.fill(ds,"aaa");
你怎么写的fill???

解决方案 »

  1.   

    就是用的 da.fill(ds,"aaa") 就在这时出错
      

  2.   

    vf6连接字符串参考www.connectionstrings.com
    using System;
    using System.Data;
    using System.Data.OleDb;
    try
    {
    OleDbConnection conn = new OleDbConnection("你的连接字符");
    OleDbDataAdapter DA = new OleDbDataAdapter("select * from table",conn);
    DataSet DS = new DataSet();DA.fill(DS,"aaa");
    dataGrid1.DataSource=DS.Tables["aaa"];
    }
    catch (Exception ex)
    {
       throw ex;
    }如果有错误,把提示信息贴出来。
      

  3.   

    private void openDB()
    {
    string cnString= "SourceDB=\\\\172.16.1.66\\sunco\\inback;PWD=;SourceType=DBF;DSN=foxTosql;Deleted=Yes;" +
    "Collate=Machine;Exclusive=No;BackgroundFetch=Yes;Null=Yes;UID=";
    cn.ConnectionString =cnString;

    cn.ConnectionString =cnString;
    cn.Open ();
    }
    openDB();
    try
    {
    sql="select * from AN16UI4F";

    OdbcDataAdapter da=new OdbcDataAdapter(sql,cn);

    DataSet ds=new DataSet ();
    da.Fill (ds);
    closeDB();
    int r=ds.Tables [0].Rows .Count ;
    }
    catch(Exception er)
    {
    string err=er.Message  ;
    closeDB();
    }*****错误信息:"ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'an16ui4f.dbf' does not exist.
      

  4.   

    File 'an16ui4f.dbf' does not exist.
      

  5.   

    如果把程序放到本地的话,就没问题\\172.16.1.66\sunco\inback确定是否有访问该目录的权限
    或用映射驱动器把\\172.16.1.66\sunco\inback作为一个盘符
      

  6.   

    \\172.16.1.66\sunco\inback确定是否有访问该目录的权限
    或用映射驱动器把\\172.16.1.66\sunco\inback作为一个盘符
    我已经按你说的做了还不行啊