question

MayurNagrale-3326 avatar image
0 Votes"
MayurNagrale-3326 asked

'Updating data in a linked table is not supported by this ISAM.' When trying to update csv from c# code.

public DataSet ExecuteDataSetQuery(string dbQuerry)
{
DataSet ds = new DataSet();
string tableName = new FileInfo(FilePath).Name;
string table = tableName.Split('.')[0];
if (dbQuerry.Contains(table))
{
dbQuerry = dbQuerry.Replace(table,tableName);
}
using (OleDbConnection cn = new OleDbConnection(conStrFrCsv))
{
//,new FileInfo(fileName).Name
//"select *from NewData.csv"
using (OleDbCommand cmd = new OleDbCommand(string.Format(dbQuerry), cn))
{
try
{

                     cn.Open();
                     using (OleDbDataAdapter adapter = new OleDbDataAdapter(cmd))
                     {
                         adapter.Fill(ds);
                     }
                 }
                 catch (Exception ex)
                 {
                     throw;
                 }
                 finally
                 {
                     cn.Close();
                 }
                 return ds;

             }
         }
     }
office-access-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers