[SOLVED] File Import |
5/23/2016 18:14:32 | |
| ASPRunner.NET General questions | ||
|
I need a way to import data to a table every 2 weeks. This data is a refresh of existing data. What I am trying to do is delete all records from the table prior to inserting new. The import will be under 500 records and about 12 fields. I can easily do this manually, but want to allow the system admin to take care of it through import data. |
||
|
|
Sergey Kornilov admin 5/24/2016 |
|
I guess you can use BeforeImport event ( http://xlinesoft.com/asprunnernet/docs/before_import_started.htm ) and here is the sample code: tDAL.CustomQuery("delete from SomeTable"); |
|
|
|
Pete K 5/24/2016 |
|
Isn't it better to use truncate table rather than delete from table? I know this is true if you are using an identity field for the PK. |
|
|
|
jadach authorDevClub member 5/24/2016 |
|
Thanks Peter. I tried that approach and nothing was deleted. |
|
|
|
Pete K 5/26/2016 |
|
Thanks Peter. I tried that approach and nothing was deleted.
|
|
|
|
jadach authorDevClub member 5/26/2016 |
|
Ok, here was my problem. I tried using this on before import started and it did nothing. |
|