473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

updating a text file using 'Microsoft.Jet.OLEDB.4.0' driver



I'm exporting data from sqlserver into a text file. I don't want to use a
linked server or DTS.

I have no problem getting the data into the correct dataset (the dataset
linked to the text file), but for some reson the text file is not written to
durring the update. Please help.

..

..

..

OleDbDataAdapter edapt = new OleDbDataAdapter(exml.Sql,econn); // passing
connection to text file

OleDbDataAdapter dapt = new OleDbDataAdapter(xml.Sql,conn);// passing
connection to sqlserver

OleDbCommandBuilder ecb = new OleDbCommandBuilder(edapt);

ecb.QuotePrefix = "[";

ecb.QuoteSuffix = "]";

DataSet edset = new DataSet();// text dataset

DataSet dset = new DataSet();//sqlserver dataset

try

{
edapt.Fill(edset,exml.Catalog);

edset.Tables[exml.Catalog].Columns["machine_Key"].Unique = true;

ecb.RefreshSchema();
Console.WriteLine(edset.GetXml()); //empty

dapt.Fill(dset,exml.Catalog);
edset.Merge(dset,true,System.Data.MissingSchemaAct ion.Add);

//Console.WriteLine("\n\n\n" + edset.GetXml()); //full - therefore, data
was merged

edset.AcceptChanges();

edapt.Update(edset,exml.Catalog);

Console.WriteLine(ecb.GetInsertCommand().CommandTe xt); // looks good

edset.Dispose();

dset.Dispose();

ecb.Dispose();

}

catch( Exception e)

{

Console.WriteLine(e.Message);

}

finally

{

}
Jul 21 '05 #1
0 1117

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nick | last post by:
Hi, I have a scenario wherein I need to update a record in a CSV file. However, it seems that with the connection string I am using, strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data...
1
by: Bryan Masephol | last post by:
Hi All I have a OleDbConnection as the "connection" below. I'm retriving a dataset from an access 2002 db and displaying it in a DataGrid. I'm making the connection to my access db file with...
1
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a...
0
by: foobar | last post by:
I'm exporting data from sqlserver into a text file. I don't want to use a linked server or DTS. I have no problem getting the data into the correct dataset (the dataset linked to the text...
2
by: barret bonden | last post by:
(closest newsgroup I could find) Error Type: ADODB.Recordset (0x800A0CB3) Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype....
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
14
by: mfrsousa | last post by:
hi there, i have a huge large text file (350.000 lines) that i want to import to a MS Acccess Database, of course i don't want to use Access, but do it with C#. i already have tried the...
0
by: MightyFeldar | last post by:
I've looked just about everywhere and pieced together as best as I can the code to update the tracking number in a CSV file for an order that has shipped out from our company so we can upload the...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In the Registry at HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text the default key for Text Format is: "Format" = "CSVDelimited" I can use the following OleDB...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.