I'm working on a C# application that reads/saves data in some old dbf-files.
(using Microsoft Visual FoxPro - driver)
I haven't had any problems until recently, when i tried querying a table i had'nt used before and i got this error message. This table is somewhat special since it has 500+ columns, i suspect that this might have something to do with it - but nothing I've googled so far gives any indications to this causing any problems.
I've had a look at this document and checked that the header record count matches the actual count (1 record);
This document is the only good tip I've found so far, that does not require any heavy dbf-repair tools.
I've tried using both the Microsoft Visual FoxPro - and the VFPOLEDB driver, they both give more or less the same error message.
I've tried passing the TableValidate = 0 command, without success.
Does anybody have any experience with a way to solve/work around this, preferably using C#.
VFP tables don't support 500 columns, so this isn't a VFP table. You need to find out what kind of table it is and use the appropriate driver to open it.
If the table is damaged, you can use CmRepair.app to fix it. This program is a Visual Foxpro 8 application (not a compiled .EXE), so you need VFP to execute it.
If you don't have VFP installed, you can download an utility program I made to execute VFP scripts and .APPs in customers that haven't VFP installed. The VFP8 runtimes are available here. Then you run the program with runner CmRepair.app and repair the table.
Good luck!
From the comment from Tamar, it got me to thinking of yet another application database that used .DBF file formats... Clipper. Here's a link that describes their table capacities..
Apollo database - (Clipper)
This might be a missing link you are looking for.
Related
I recently had a new project assigned to me (I'm new to C# and I'm a junior). It makes use of a Microsoft access database file (.accdb file)
I've imported the project into Visual Studio but I can't for the life of me run the code. Initially I had file register issues, and I think I managed to resolve that by getting the IT teams to install a "2007 Office System Driver: Data Connectivity Components" driver from the Microsoft website.
Bow the error says:
System.Data.OleDb.OleDbExceptions: 'Cannot open database''. It may not be a database that your application recognizes, or the file may be corrupt.'
The team I'm trying to help only has one dev (working from a different country) who is the main person to handle the code. It works on her side, but she doesn't really have the experience to help me troubleshoot this.
I tried sending her my database file, for her to swap her file for mine, and she said it was still working, so it sounds like the issue might not be to do with the file?
Could I get any help if possible? So far my only approach is to keep googling the error.
But the only resolutions I see are from people who have database files nearing their file size limit (2GB). My database file is just 1MB.
The database file is password protected (the password happens to be in the code). I opened the database file (Microsoft access opens) and entered the password and I had no issue accessing the data)
Out of luck, I managed to find the right article to help me!
The issue with Microsoft access database files is only one user can really use then at a time I believe.
I saw a forum about potential locks made by other users. I googled how to remove locks but it seems that it might not be a lock issue (Microsoft creates a lock file which I dont have).
Regardless, I assumed that the issue is still somewhat similar. Since I had access to the database in Microsoft Access, I decided to open a new database, then go to external data tab and click on access to import EVERYTHING from the other file. Then I just renamed to old file and give my new file the original name.
I reran the code and it worked!
I dont know why the other dev had no issue opening the file. My assumption is that because she is the only developer her laptop is already 'set up' in some way to run everything as normal, whereas if someone new tried (or if something happens and she has to re-open the code on a new laptop) they would have to try and replicate the 'set up' or try and work from scratch
Hope this helps
when i try to import excel in winform application(C#) i got error.
Error Message -> "Unexpected error from external database driver"
It seems to be an issue with the latest Microsoft update (KB4041687). A couple of our customers had this problem this morning. The update seems to have had a somewhat adverse effect on the Microsoft.Jet.OLEDB.4.0 driver with regard to Excel connections. This is just one of many problems with this particular update.
See article here.
I advised our customers to roll back the update and everything started working again. Obviously this is a temporary solution but until such time as a fix is available it's all I could advise.
I'm trying to diagnose issues updating Google Fusion Tables using CSV data via the API. Everything seems to work correctly code side of things with no errors reported but the data does not reflect the changes. Any ideas how I can diagnose what is going wrong?
I've been using the Google.Apis.Fusiontables.v2 C# libraries (v1.27.1.833 is latest I've tried) to update a fusion table daily. The process was working seamlessly for quite a while, but now no longer seems to work. I suspect the process has been broken for a month or more now.
Everything seems to work from the code side of things, no errors reported. I've also been debugging the process from within Visual Studio with no problems indicated - it just seems to work from the client side.
In case it's useful the C# method I'm using is:
fusiontablesService.Table.ReplaceRows(tableId, stream, "application/octet-stream").Upload();
The table I am attempting to update is - https://fusiontables.google.com/DataSource?docid=1ndrFm1g0iZpz5gszjz5Ij9r_KiQbNYRXVM2JNfv3
The UpdatedUtc column indicates that a few updated rows are getting through, but not all of them.
If I export my CSV stream to a physical file and created a new Fusion Table manually via the web UI this works perfectly and shows all the missing data I expect to be there.
Here's the zipped CSV file in case it's useful - http://www.paydirt.co.nz/stackoverflow/GoldPermits.zip
This is the test Fusion Table I imported the CSV file manually into - https://www.google.com/fusiontables/DataSource?docid=1Udnre88O8e1zokvnhrkmqdY7BbYD2OQtELdyz3uG
Example of missing data in the live table updates:
Compared to the test table created from the same data:
The PERMIT_NUMBER's for the 2 missing rows in the example are 60304 and 60247.
Any ideas how I can investigate further what might be going wrong? Maybe there's some logs or logging options available somewhere I'm unaware of?
Any help / ideas to explore is greatly appreciated.
Upload from fusiontablesService.Table.ReplaceRows(...).Upload() returns a Google.Apis.Upload.ResumableUpload.ResumableUploadProgress object which has both aStatus and Exception property that can be checked.
In my case I was getting the following progress result:
{Google.Apis.Upload.ResumableUpload.ResumableUploadProgress}
BytesSent: 10485760
Exception: {"Google.Apis.Requests.RequestError\r\nContent has a different number of columns than the table (line 1). [400]\r\nErrors [\r\n\tMessage[Content has a different number of columns than the table (line 1).] Location[ - ] Reason[badImportNumColumnsMismatch] Domain[fusiontables]\r\n]\r\n"}
Status: Failed
I've created a project in installshiel program uses SQL Server 2008 and written in C#.
Everything works fine and scripts of database also works fine but I had error when trying to install program which is created by installshield
error is
Error 27506. Error executing SQL script db_name.sql. Line 9
The CREATE DATABASE statement failed. The primary file must be at least 3
MB to accomodate a copy of the model database. (1803)
I tried to search in google but I couldn't find any results
please help
There is absolutely nothing wrong with the installer. It's doing exactly what it was told to do: Execute a SQL script that was injected into it and report any errors that occur.
You didn't actually provide the contents of the SQL but basically you need to look at the CREATE DATABASE statement paying attention to the SIZE, MAXSIZE and FILEGROWTH arguments.
My aim is to backup a database (.mdf) as one file with my web application project written in C#.
The backup should later on be loaded on a "restore"-page, where the data in the backed-up tables could be appended to the original database row by row.
What would be a good practice to implement this?
I thought of just copying the mdf file, but then I read about attaching and detaching of the database. Furthermore I don't know what to do with the _log.ldf file.
I'm looking forward to your hints. Thank you in advance for your help!
EDIT: I can only use the free SQL Server Express for this, because I want to distribute my program to other people.
Probably, you refer to the Backup and Restore using C# for Sql Server to get a complete idea about writting a code in C#, which has helped me a lot when I was using it.
By the use of Backup class in C#, you can get all the facilities to backup as well as restore.
If you are only interested in appending the data rowwise afterwards, perhaps it is easier to export each table to CSV and import it afterwards (so you have rowwwise control in C#).
If you insist ine one file, just add all the CSV's to a zip.
You can use the FileHelpers library for this (http://www.filehelpers.com/) and you will have it up&running in no time.
Apparently there is a Backup class in the SQL Server Management Objects library.
You might want to check that out first, as it doesn't look overly complicated:
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.backup.aspx
It would require you to have two or three libraries installed on the server you run it on, though they are fairly small - not Windows SDK sized...
pls go through this link on how to backup data and restore using c# and sql server .In addition to you have to add these names spaces
Microsoft.SqlServer.Management.Smo;
Microsoft.SqlServer.Management.Common;