SQL Server Comact Error 0XC0000005 After Device Is Powered Off And Back On
Mar 12, 2008
This is my first attempt to use SQL Server Compact with Visual Studio 2005.
I wrote a program for Inventory Scaning which requires the database to be stored on an SD Card. As long as the device is left powered on, the programs function normally. However, if the device powers off and is then turned back on the 0xC0000005 error is displayed when the program attempts to do anything with the SQL Connection.
I have also written a small sample program to test and the results are repeatable each time.
The sample program consists of a single form with six buttons (Create Database, Open Database, Insert Records, Delete Records, Close Database, Dispose Database).
Both programs are written in VB.
Here is the code for the sample program.
Public Class frmSQLTest
Private cnDB As System.Data.SqlServerCe.SqlCeConnection
Private connString As String
Private Sub frmSQLTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.txtDB.Text = "Storage CardTest.sdf"
End Sub
Private Sub txtDB_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtDB.LostFocus
connString = "Data Source=" & Me.txtDB.Text
Me.txtStatus.Text = "Connection String Set"
End Sub
Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click
If Me.txtDB.Text = Nothing Then
MessageBox.Show("Unable to Create Database")
Exit Sub
End If
Dim eng As New System.Data.SqlServerCe.SqlCeEngine(connString)
eng.CreateDatabase()
eng = Nothing
Me.txtStatus.Text = "Database Created"
End Sub
Private Sub btnOpenDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenDB.Click
Dim sqlDB As New System.Data.SqlServerCe.SqlCeCommand
If cnDB Is Nothing Then
cnDB = New System.Data.SqlServerCe.SqlCeConnection(connString)
End If
cnDB.Open()
Me.txtStatus.Text = "Database Opened"
sqlDB.Connection = cnDB
sqlDB.CommandText = "CREATE TABLE Master (Item nvarchar(12), Description nvarchar(19))"
sqlDB.ExecuteNonQuery()
sqlDB.CommandText = "CREATE INDEX idx_Master on Master (Item)"
sqlDB.ExecuteNonQuery()
Me.txtStatus.Text = "Master Table Created"
sqlDB = Nothing
End Sub
Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsert.Click
Dim RecCount As Long
Dim sqlDB As New System.Data.SqlServerCe.SqlCeCommand
sqlDB.Connection = cnDB
For RecCount = 1 To Me.nudRecs.Value
sqlDB.CommandText = "INSERT INTO Master ([Item], [Description]) " _
& "VALUES ('" & RecCount.ToString & "','Test Item " & RecCount.ToString & "')"
sqlDB.ExecuteNonQuery()
If RecCount Mod 100 = 0 Then
Me.txtStatus.Text = "Updating Record..." & RecCount.ToString
End If
Next
Me.txtStatus.Text = "Records Inserted"
sqlDB = Nothing
End Sub
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim sqlDB As New System.Data.SqlServerCe.SqlCeCommand
sqlDB.Connection = cnDB
sqlDB.CommandText = "Delete FROM Master"
Me.txtStatus.Text = "Master Table Cleared"
sqlDB = Nothing
End Sub
Private Sub btnCloseDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCloseDB.Click
cnDB.Close()
Me.txtStatus.Text = "Database Closed"
End Sub
Private Sub btnDispose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDispose.Click
cnDB = Nothing
System.IO.File.Delete(Me.txtDB.Text)
Me.txtStatus.Text = "Database Diposed"
End Sub
End Class
In my tests, I start the program (loaded on the Storage Card in the same directory as the database). SQL Server Compact is also installed on the SD Card to save space in Main Memory.
Steps to Re-Create the Error:
1. Click the Create Database button. Database is created properly.
2. Click the Open Database button. Database connection opens properly.
3. Click the Insert Records button. Records are inserted into the table properly.
4. Turn off the Symbol MC3000 unit.
5. Turn the unit back on.
6. When I click on any of the following buttons, the error is displayed. Close Database, Insert Records, Delete Records.
I have also tried closing the database (as well as closing and disposing the database) prior to step 4 above, but when I try to re-open the database (or create the database) again, the error displays.
Is there anyway to correct this issue?
With the real program, the database must be kept open as long as each form is open to prevent speed issues and the database must be stored on the SD Card since there is not enough storage space available on the device.
View 3 Replies
ADVERTISEMENT
Sep 5, 2001
Is there any SYSTABLE or table from where I can get the backup device logical name.
Thanks,
-Rajesh
View 1 Replies
View Related
Apr 28, 2008
I'm getting the error message "The parameter is incorrect" when I'm trying to perform "Show Table Data" from the SQL Server Compact Edition" within VS 2008. Any ideas? Thank you in advance,
.
View 6 Replies
View Related
Jan 12, 2007
Hi all , hope my post finds u all well.
Currently I was reading about how to create a backup and i have some questions and i hope to find helpful answers..
what is back up media ,device and tape ?
how to initialize the media and what is the need for something like that ?
what about media headers that must be written ?
thanks in advance
Davids Maguire
View 1 Replies
View Related
Nov 6, 2007
I want to back up my database to a logical drive and restore it from this logical device. But I am unable to see my logical device through sql server management studio interface. I am able to back up to a logical device and restore it from logical device through T-SQL code. I am wondering how come I am unable to see my logical device from sql server management studio interface. Is there any way, I can solve this problem? Thanks in advance.
View 3 Replies
View Related
Feb 21, 2008
I assume I'm trying to install SQL Server Express 2005 as it's part of a larger installation package (Neat Receipts Professional 3.0.3).
During the installation of SQL Server 2005, I get the following error message:
The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine ACERLAPTOP Error:3221225477 (0xc0000005)
I'm running XP Home SP2 with all known patches applied.
CPU is AMD Athlon Turion(TM) 64 Mobile Technology ML-30, 1600 MHz
I'm also running ZoneAlarm Security Suite Pro for firewall and antivirus.
If further information is needed, just ask.
Does anyone have a suggestion as to how to get past this obstacle?
Ira Smilovitz
View 1 Replies
View Related
Dec 4, 2006
Hi All,
We have written a multithreaded application in which we are maintaining separate Database connections for each thread. these connections are opened and closed at the start and exit of the thread.
We have observed that even if there is only one thread running ( application thread), execution of simple Select queries some times throws Native exception(Error - 0xc0000005 ).
This error comes intermittently. Execution of same query doesn't throw exception.
Further investigation by breaking the debug at the time of native exception and then looking into the stack trace shows that native exception has occured at one of the Native API (CompileQueryPlan() ) which is being called implicitly by the SQL Mobile.
Each time when we see native exception stack trace shows failure at CompileQueryPlan() call.
Let me know if this is a known defect in SQL Mobile 2005 or there is something else that is causing native exception.
Thanks,
Nikhil
View 11 Replies
View Related
Apr 14, 2006
Hi to All
when i m trying to execute following code
backup database web
to disk = 'c:inetpubwwwrootackupmybakup.bak'
with format
I m Getting Error like :
Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'c:inetpubwwwrootackupmybakup.bak'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
This error is Generated only when i m trying to access folders within "wwwroot" but not in any other folders , even command runs success fully for "wwwroot" folder . !!
but not for any subfolders of wwwroot.
Can Any One Help Me ??
View 6 Replies
View Related
Nov 15, 2006
Hi,
I have a package which reads an XML file from a certain folder and parses it.
I deployed my package onto the server. Copied XML files on the D: drive the following folder on the server.
Dim reader As New Xml.XmlTextReader("D:AppsRequestClientsClientsStatus.xml") is fine.
But
Do While (reader.Read())
generates "The Device is not ready"
I think it is still trying to read it from my desktop on which I don't have a D drive.
Any help is appreciated.
View 13 Replies
View Related
Aug 11, 2009
It's OS / SQL related. I backup to a UNC device, and frequently get a network related error - but not always. And the error is also OS related...
The scene: 64 bit Windows Server 2008 hosts 64 bit SQL 2008 Standard, and devices are created to point to 64 Server 2008 Server B (ServerBSQL_backupsdvc_DB.bak). The database is backed up daily, on a job, and when run the following error is returned:
Date2009/08/08 06:43:30 AM
LogJob History (Backup_AssetData_2009-08-08)
Step ID3
ServerSQL01
Job NameBackup_AssetData_2009-08-08
Step NameBackup Database - Second Attempt
Duration00:05:33
Sql Severity16
Sql Message ID3013
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted0
Message
Executed as user: COMPANYSERVICE_USER. Processed 94096 pages for database 'AssetData', file 'AssetData' on file 1. [SQLSTATE 01000] (Message 4035) Processed 1 pages for database 'AssetData', file 'AssetData_log' on file 1. [SQLSTATE 01000] (Message 4035) The operating system returned the error '64(failed to retrieve text for this error. Reason: 15105)' while attempting 'FlushFileBuffers' on 'dvc_AssetData(
iscsrv-dcm04RISCSRV-SQL01_Backupsdvc_AssetData.bak)'. [SQLSTATE 42000] (Error 3634) BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.
The file is generated, the same size as a successful backup, but the job terminates unsuccessful.I have tried to delete the devices' file, and then the backup usually succeeds. This may point to a permissions' type error, but the user the job is run under is a domain admin. The destination server is not unavailable during this time, and the network shares also remain active throughout the excersize - although I haven't got a way to "prove" this.
I have a few databases that backup to the UNC described above (different files) that don't fail..My SQL2000 server backs up it's databases to the SQL2008 server, and those backups don't fail with this error.
My research has led me to understand that the 64bit OS tries to buffer the files it receives from another server, and I was wondering if this could be influencing the backups as the destination server is also 64 bit Windows Server 2008.
##20090812## UPDATE
I tried another way to do the backup; with the same results:
Backup database Infovest to disk = '
iscsrv-dcm04
iscsrv-sql01_backupsdvc_Infovest_Z.bak' with INIT,STATS=1
[code]....
View 9 Replies
View Related
Feb 9, 2007
I have set up a locahost site in IIS using the "Configure Web Synchronization Wizard". One of the first test I was asked to do was to open a broweser and browse to http://localhost/MobileTest/sqlcesa30.dll
If all is well I should get a web page with the following line:
SQL Server Mobile Server Agent 3.0
But unfortunately I get an error stating :
"The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance."
I checekd the Event log and found this error related the IIS launch process on my machine.
DCOM got error "Logon failure: unknown user name or bad password. " and was unable to logon .IWAM_Rataq in order to run the server:
where Rataq is the name of my machine. Could my IWAM_Rataq account be corrupted, my other sites on the machine work.
Infact if i put in a Test.htm page in the virtual directory MobileTest I am able to browse to the page.
Can the Account be re-set? is there another problem that I am not aware of. I have Norton Internet 2006 running could that be the reason? Could Norton be blocking the dll from loading? But the event log states it is a Account error.
Any ideas why this might occur? any help is always appreciated
View 1 Replies
View Related
Sep 22, 2006
Does anybody know of a way to rollback SQL Server 2005
databases back to SQL Server 2000? Is there a way of doing it without
resorting to Copy Database Wizard? I love to find a way of attaching a SS 2005 database
to a SS 2000 instance without any issues.
I recently upgraded to SS 2005 and I am very unhappy with the SS 2005 and I
want to rollback to SS 2000, which was a lot more stable. I am having
several major issues that are affecting my whole company's day-to-day
operations and the managers are not happy. Some of the issues include
night time batch running very sluggish for no apparent reason. This is a
biggest problem because it only occurs once or so a week and causes a disturbance
with the daily activities when the night time processing isn€™t completed on
time. The rest of the time, the batch processing runs great, even a little better then on SS 2000. I
don't believe it is a matter of my application needing to be retuned because if
that was the case, then why isn't it running sluggish every night? Also,
it's never the same day that the sluggish behavior occurs. If it was occurring
on the same night, then I would have something to investigate within our
application, but it doesn't. Another issue that I am having involves a
night time job that restores a copy of the production database to the Data
Warehouse server to be used for updating the data warehouse. Again, most
of the time it runs great (~2 1/2 hours), but once or twice a week, it goes
stupid and takes 6 1/2 hours for no apparent reason. Again, it is not happening
the same day either, which could give me something to invesigate. On SS 2000, this same job ran flawlessly. Never I did I run into situation that the
database restoration took that long to run. Even another issue involves a SQL Server Agent Job that was put into suspended
state. What's a suspended state and how can I get it out of suspended
state? I can find no information about suspended state in BOL. I
did a Google and nothing came up. If this suspended state was put
in for security reasons, great, but then tell me how I can remove the suspended
state. I am also not happy with the
fact that I can't get accurate information about the queries that are actively
running at that particular moment. In SS 2000, when I noticed high CPU
usage on the server, I would run the sp_who2 active stored proc and it would
show me all the active thread and how much CPU it was consuming. I would
then find the running threads with the highest CPU numbers and investigate the
query and see if we could improve it. Now in SS 2005, I get in the same
situation and run the sp_who2 stored proc, and there is no smoking gun.
All of the active threads are showing very little CPU usage, which I am very
suspect of. What the heck happen to sp_who2? I looked at some of
the other ways of looking at running processes (i.e... sys.sysprocesses) and
they don't appear to be giving the information that I need.
I am very unhappy and I just want to roll back to SS 2000 and wait a couple of
years before I upgrade to SS 2005.
Dave Brown
View 1 Replies
View Related
May 23, 2007
We are using sql server 2005 Enterprise Edition with service pack1
I got the following error messages in the SQL log
The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000090000 in file '....mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
fcb::close-flush: Operating system error 21(The device is not ready.) encountered.
I got these errors for about 2 hrs and after that I see these messages in the sql log
Starting up database ' '
1 transactions rolled forward in database '' (). This is an informational message only. No user action is required.
0 transactions rolled back in database ' ' (). This is an informational message only. No user action is required.
Recovery is writing a checkpoint in database ' ' ( ). This is an informational message only. No user action is required.
CHECKDB for database '' finished without errors on (local time). This is an informational message only; no user action is required.
Can anyone please help me in troubleshooting this issue. Why this migh have happened.
any help would be appreciated.
Thanks
View 5 Replies
View Related
Jul 25, 2007
my sql server give me a error log,who can help me?
2007-07-06 09:58:46.09 spid56 SqlDumpExceptionHandler: Process 56 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process..
*******************************************************************************
*
* BEGIN STACK DUMP:
* 07/06/07 09:58:46 spid 56
*
* Exception Address = 00402484
* Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
* Access Violation occurred reading address 199A0F64
* Input Buffer 190 bytes -
* delete from cms_paramdb1..Param where PatientiID = 427 and Occurtime =
* '2007-06-12 17:51:39'
*
*
* MODULE BASE END SIZE
* sqlservr 00400000 00B19FFF 0071a000
* ntdll 7C920000 7C9B3FFF 00094000
* kernel32 7C800000 7C91BFFF 0011c000
* ADVAPI32 77DA0000 77E48FFF 000a9000
* RPCRT4 77E50000 77EE0FFF 00091000
* USER32 77D10000 77D9EFFF 0008f000
* GDI32 77EF0000 77F35FFF 00046000
* OPENDS60 41060000 41065FFF 00006000
* MSVCRT 77BE0000 77C37FFF 00058000
* UMS 41070000 4107CFFF 0000d000
* SQLSORT 42AE0000 42B6FFFF 00090000
* MSVCIRT 00300000 00310FFF 00011000
* ShimEng 5CC30000 5CC55FFF 00026000
* AcSpecfc 71540000 71580FFF 00041000
* ole32 76990000 76ACBFFF 0013c000
* SHELL32 773A0000 77B90FFF 007f1000
* SHLWAPI 77F40000 77FB5FFF 00076000
* WINMM 76B10000 76B39FFF 0002a000
* DDRAW 736D0000 73718FFF 00049000
* DCIMAN32 73B30000 73B35FFF 00006000
* USERENV 759D0000 75A7DFFF 000ae000
* MPR 71A90000 71AA1FFF 00012000
* PSAPI 76BC0000 76BCAFFF 0000b000
* comdlg32 76320000 76366FFF 00047000
* COMCTL32 5D170000 5D206FFF 00097000
* IMM32 76300000 7631CFFF 0001d000
* WS2_32 71A20000 71A36FFF 00017000
* WS2HELP 71A10000 71A17FFF 00008000
* LPK 62C20000 62C28FFF 00009000
* USP10 73FA0000 7400AFFF 0006b000
* comctl32 77180000 77281FFF 00102000
* sqlevn70 41080000 41086FFF 00007000
* NETAPI32 5FDD0000 5FE23FFF 00054000
* wmi 76D00000 76D03FFF 00004000
* SSNETLIB 42CF0000 42D05FFF 00016000
* WSOCK32 71A40000 71A4AFFF 0000b000
* SSNMPN70 410D0000 410D5FFF 00006000
* security 71F00000 71F03FFF 00004000
* SECUR32 77FC0000 77FD0FFF 00011000
* crypt32 765E0000 76671FFF 00092000
* MSASN1 76DB0000 76DC1FFF 00012000
* VERSION 77BD0000 77BD7FFF 00008000
* SSmsLPCn 42CD0000 42CD6FFF 00007000
* ntdsapi 76770000 76782FFF 00013000
* DNSAPI 76EF0000 76F16FFF 00027000
* WLDAP32 76F30000 76F5BFFF 0002c000
* sqlimage 4A400000 4A40CFFF 0000d000
* DBGHELP 020F0000 02102FFF 00013000
*
* Edi: 19991FFC: 16290F65 00000000 00000000 00000000 00000000 00000000
* Esi: 01F6D244: 19990F65 0000FFFF 00000000 00000000 01F6D2D8 00000000
* Eax: 19990F65: FFFFFFFF FFFFFFFF 75405AFF 8C969852 03DB62E5 FFFFFFFF
* Ebx: 19990000: 00000301 00FF0000 00000000 00000000 00000000 00060000
* Ecx: 0000FFFF:
* Edx: 00000026:
* Eip: 00402484: 0114B70F 83145689 EAC107C2 0A4C8D03 184E8902 752000F6
* Ebp: 01F6D264: 01F6D298 00576A9E 00000001 01F6D310 01F6D308 01F6D2D8
* SegCs: 0000001B:
* EFlags: 00010202: 0053005C 00730079 00650074 0033006D 005C0032 00620057
* Esp: 01F6D234: 01F6D244 0040289C 01F6D2D8 00408FEA 19990F65 0000FFFF
* SegSs: 00000023:
*******************************************************************************
-------------------------------------------------------------------------------
Short Stack Dump
00402484 Module(sqlservr+00002484)
00576A9E Module(sqlservr+00176A9E) (SQLExit(unsigned long)+00021C8C)
0057620B Module(sqlservr+0017620B) (SQLExit(unsigned long)+000213F9)
005021AC Module(sqlservr+001021AC)
0041ED96 Module(sqlservr+0001ED96)
00442DD0 Module(sqlservr+00042DD0)
004BFD41 Module(sqlservr+000BFD41)
00427985 Module(sqlservr+00027985)
004271BA Module(sqlservr+000271BA)
0042EA36 Module(sqlservr+0002EA36)
0042E82D Module(sqlservr+0002E82D)
004160DB Module(sqlservr+000160DB)
00415765 Module(sqlservr+00015765)
00415410 Module(sqlservr+00015410)
005A683F Module(sqlservr+001A683F) (SQLExit(unsigned long)+00051A2D)
004160DB Module(sqlservr+000160DB)
00415765 Module(sqlservr+00015765)
00415410 Module(sqlservr+00015410)
00459A54 Module(sqlservr+00059A54)
004175D8 Module(sqlservr+000175D8)
410735D0 Module(UMS+000035D0) (UmsSystemUserContext::UmsSystemUserContext(class UmsScheduler *,struct UMS_SYSPARAMS *)+00000434)
4107382C Module(UMS+0000382C) (UmsScheduler::FiberEnabled(void)+000001D2)
77C0A243 Module(MSVCRT+0002A243) (_endthread+000000AF)
7C80B50B Module(kernel32+0000B50B) (GetModuleFileNameA+000001B4)
-------------------------------------------------------------------------------
2007-07-06 09:58:46.26 spid56 Error: 0, Severity: 19, State: 0
2007-07-06 09:58:46.26 spid56 language_exec: Process 56 generated an access violation. SQL Server is terminating this process..
2007-07-06 09:58:50.28 spid57 Error: 7105, Severity: 22, State: 6
2007-07-06 09:58:50.28 spid57 Page (1:3568), slot 0 for text, ntext, or image node does not exist..
View 6 Replies
View Related
Oct 3, 2007
Greetings,
I have written a very basic C# console test app to check the performance and reliability of SQLCE on Windows CE 5.0 (source code below). Running this on different Windows CE 5.0 devices, I always get a 0xc0000005 native exception error when reaching 25592 inserts. It doesn't matter whether the database is empty or not when the test is run, it always fails at that exact number of inserts. Given that I would expect a managed application not to be able to generate native exceptions anyway, and can't really see any reason why it would in this case, I'm at a bit of a loss as to what's going wrong... Any ideas?
Using:
VS2005 w/ SP1
Windows CE 5.0 (on custom SH4 platform and HTC WM5 smartphone)
.NET CF 2.0 w/ SP1 and post SP1 patch
SQLCE 3.0.3600.0
TIA
PS. The same code (with some SQLCE 3.0 specific bits removed - version and result set for checking table existence) works perfectly under .NET CF 1.0 and SQLCE 2.0).
Source code:
using System.Data;
using System.Data.SqlServerCe;
namespace TestDB
{
class Program
{
static void Main(string[] args)
{
SqlCeConnection sqlConnection = new SqlCeConnection();
SqlCeCommand sqlCommand = sqlConnection.CreateCommand();
SqlCeResultSet sqlResult;
string strDatabase = "\TestDB.sdf";
string strTable = "TestTable";
try
{
// Database connection string
sqlConnection.ConnectionString =
"Data Source=" + strDatabase;
// Database file doesn't exist?
if (!System.IO.File.Exists( strDatabase ))
{
Console.WriteLine("Creating database: " + strDatabase);
// Create SQL engine object
SqlCeEngine sqlEngine = new SqlCeEngine(
sqlConnection.ConnectionString);
// Use it to create database
sqlEngine.CreateDatabase();
}
Console.WriteLine("Opening database: " + strDatabase);
// Open database connection
sqlConnection.Open();
// Display SQL version
Console.WriteLine("SQL Version: "
+ sqlConnection.ServerVersion.ToString());
// Check if table exists
sqlCommand.CommandText = "SELECT TABLE_NAME FROM "
+ "INFORMATION_SCHEMA.TABLES WHERE "
+ "TABLE_NAME = '" + strTable + "'";
sqlResult = sqlCommand.ExecuteResultSet(
ResultSetOptions.Insensitive);
// Table doesn't exist?
if (!sqlResult.Read())
{
Console.WriteLine("Creating table: " + strTable);
// Create table
sqlCommand.CommandText = "CREATE TABLE " + strTable
+ "(Sequence integer IDENTITY(1,1) NOT NULL PRIMARY KEY, "
+ "Timestamp datetime DEFAULT GETDATE(),"
+ "Message nvarchar(80))";
sqlCommand.ExecuteNonQuery();
}
string strText;
for (int i = 1; i <= 500000; i++)
{
Console.Write("
Inserted " + i.ToString() + " records ");
strText = "Row Number: " + i.ToString();
sqlCommand.CommandText = "INSERT INTO " + strTable
+ " (Message) VALUES ('" + strText + "')";
sqlCommand.ExecuteNonQuery();
}
}
// SQL error
catch(SqlCeException sqlex)
{
// Display all error messages
Console.WriteLine( "ERROR:" );
foreach (SqlCeError sqlError in sqlex.Errors)
{
Console.WriteLine( sqlError );
}
}
// Other errors
catch(Exception ex)
{
// Display error message
Console.WriteLine( "ERROR:" );
Console.WriteLine( ex.Message );
}
finally
{
// Close connection
if (sqlConnection.State != ConnectionState.Closed)
{
Console.WriteLine("Closing database");
sqlConnection.Close();
}
}
Console.ReadLine();
}
}
}
View 6 Replies
View Related
Nov 17, 1998
I have a database in development in SQL Server 6.5 that needs to be occasionally deleted and rebuilt from a script when table structures are changed. I found that when very complex queries were performed, the 2 MB default size of tempdb filled up and returned errors, so I went to the Enterprise Manager to expand tempdb, learned that I had to first expand a device to expand tempdb into, and foolishly chose to expand tempdb into the same device space used by my application, instead of into one of the system databases. Now when I try to delete the device in preparation for its rebuild, the Enterprise Manager responds with an error message saying the device can't be deleted because it contains system tables. Is there any way to get the expanded portion of tempdb out of my application device so that the device can be deleted, without reinstalling SQL Server?
View 1 Replies
View Related
Apr 5, 2007
Hi All,
Currently I have a PC that has MSDE installed on it and is attached to database (MyData.MDF and a log file MYLog.LDF) located on its hard drive at c:data. When I detach from the database, place a copy of the two files noted above on my network drive @ u:data and try to attach I get the following error€™s:
SQL[1] exec error = -1: Changed database context to 'master'.
€œDevice activation error. The physical file name u:dataMyData.MDF may be incorrect.€?
I have done some testing a have found that I can attach to a copy of my database if I move it anywhere on the c: drive, and or even to a 1Gb USB key attached to the system(e:). So far it seems to only be an issue if I move it to a mapped network drive. If anyone could please provide me with any info it would be greatly appreciated.
Thanks.
James D.
View 4 Replies
View Related
Nov 30, 2006
Hi i am connecting to a DB2 database on a AS400 machine from SQL server 2005.
I have setup a linked server to connect to the DB2 database.
Most of the time the query ( select * from OPENQUERY(lnkd_svrname,'select abc from svr_name.lib_name.tablename') ) works fine but at times it comes up with the following error.
I am running SQL server 2000 Std. Edition on a WIN 2000 machine.
Any help would be appreciated .
*****ERROR*****
From the Exception.Log file
11/30/06 09:38:59 spid 69 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 637B7FC0 at 0x77387EAC
STACK DUMP ----------------------------------
=====================================================================
BugCheck Dump
=====================================================================
This file is generated by Microsoft SQL Server
version 9.00.1399.06
upon detection of fatal unexpected error. Please return this file,
the query or program that produced the bugcheck, the database and
the error log, and any other pertinent information with a Service Request.
***Stack Dump being sent to C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGSQLDump0024.txt
SqlDumpExceptionHandler: Process 69 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
terminating this process.
* *******************************************************************************
*
* BEGIN STACK DUMP:
* 11/30/06 09:38:59 spid 69
*
*
* Exception Address = 77387EAC Module(USER32+00007EAC)
* Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
* Access Violation occurred reading address 637B7FC0
* Input Buffer 182 bytes -
* select * from OPENQUERY(lnkd_svrname,'select abc from svr_name.lib_name.tablename')
*
*
MODULE BASE END SIZE
* sqlservr 01000000 02BA7FFF 01ba8000
* ntdll 7C800000 7C8BFFFF 000c0000
* kernel32 77E40000 77F41FFF 00102000
* MSVCR80 78130000 781CAFFF 0009b000
* msvcrt 77BA0000 77BF9FFF 0005a000
* MSVCP80 7C420000 7C4A6FFF 00087000
* ADVAPI32 77F50000 77FEBFFF 0009c000
* RPCRT4 77C50000 77CEEFFF 0009f000
* USER32 77380000 77411FFF 00092000
* GDI32 77C00000 77C47FFF 00048000
* CRYPT32 761B0000 76242FFF 00093000
* MSASN1 76190000 761A1FFF 00012000
* Secur32 76F50000 76F62FFF 00013000
* MSWSOCK 71B20000 71B60FFF 00041000
* WS2_32 71C00000 71C16FFF 00017000
* WS2HELP 71BF0000 71BF7FFF 00008000
* USERENV 76920000 769E3FFF 000c4000
* opends60 333E0000 333E6FFF 00007000
* NETAPI32 49DE0000 49E37FFF 00058000
* SHELL32 7C8D0000 7D0D3FFF 00804000
* SHLWAPI 77DA0000 77DF1FFF 00052000
* comctl32 77420000 77522FFF 00103000
* psapi 76B70000 76B7AFFF 0000b000
* instapi 48060000 48069FFF 0000a000
* sqlevn70 4F610000 4F7A0FFF 00191000
* SQLOS 344D0000 344D4FFF 00005000
* rsaenh 68000000 6802EFFF 0002f000
* AUTHZ 76C40000 76C53FFF 00014000
* MSCOREE 34180000 341C4FFF 00045000
* ole32 77670000 777A3FFF 00134000
* msv1_0 76C90000 76CB6FFF 00027000
* iphlpapi 76CF0000 76D09FFF 0001a000
* kerberos 343F0000 34447FFF 00058000
* cryptdll 766E0000 766EBFFF 0000c000
* schannel 76750000 76776FFF 00027000
* COMRES 77010000 770D5FFF 000c6000
* XOLEHLP 344B0000 344B5FFF 00006000
* MSDTCPRX 48070000 480E7FFF 00078000
* msvcp60 780C0000 78120FFF 00061000
* MTXCLU 480F0000 48108FFF 00019000
* VERSION 77B90000 77B97FFF 00008000
* WSOCK32 71BB0000 71BB8FFF 00009000
* OLEAUT32 77D00000 77D8BFFF 0008c000
* CLUSAPI 48110000 48121FFF 00012000
* RESUTILS 48130000 48142FFF 00013000
* DNSAPI 76ED0000 76EFEFFF 0002f000
* winrnr 76F70000 76F76FFF 00007000
* WLDAP32 76F10000 76F3DFFF 0002e000
* rasadhlp 76F80000 76F87FFF 00008000
* security 48570000 48573FFF 00004000
* msfte 49910000 49B67FFF 00258000
* dbghelp 48DD0000 48EE7FFF 00118000
* WINTRUST 76BB0000 76BDAFFF 0002b000
* imagehlp 76C10000 76C38FFF 00029000
* dssenh 68100000 68123FFF 00024000
* hnetcfg 49330000 49388FFF 00059000
* wshtcpip 71AE0000 71AE7FFF 00008000
* NTMARTA 77E00000 77E21FFF 00022000
* SAMLIB 493D0000 493DEFFF 0000f000
* ntdsapi 766F0000 76704FFF 00015000
* xpsp2res 493E0000 496A4FFF 002c5000
* CLBCatQ 777B0000 77832FFF 00083000
* sqlncli 496B0000 498CDFFF 0021e000
* COMCTL32 77530000 775C6FFF 00097000
* comdlg32 762B0000 762F9FFF 0004a000
* SQLNCLIR 007A0000 007D2FFF 00033000
* msftepxy 498D0000 498E4FFF 00015000
* xpstar90 62080000 620C4FFF 00045000
* SQLSCM90 620E0000 620E8FFF 00009000
* ODBC32 62100000 6213CFFF 0003d000
* BatchParser90 62140000 6215DFFF 0001e000
* SQLSVC90 62170000 62189FFF 0001a000
* SqlResourceLoader 621A0000 621A5FFF 00006000
* ATL80 7C630000 7C64AFFF 0001b000
* odbcint 62380000 62396FFF 00017000
* SQLSVC90 623A0000 623A2FFF 00003000
* xpstar90 623B0000 623D5FFF 00026000
* xpsqlbot 62400000 62405FFF 00006000
* xplog70 62520000 6252BFFF 0000c000
* xplog70 62540000 62542FFF 00003000
* oledb32 62840000 628B8FFF 00079000
* MSDART 486E0000 486F9FFF 0001a000
* OLEDB32R 488F0000 48900FFF 00011000
* msdasql 62D80000 62DCCFFF 0004d000
* MSDATL3 62DD0000 62DE4FFF 00015000
* MSDASQLR 48700000 48703FFF 00004000
* comsvcs 62F00000 63038FFF 00139000
* cwbodbc 66F30000 66F9CFFF 0006d000
* cwbcore 676C0000 6774BFFF 0008c000
* cwbunpls 64B90000 64B99FFF 0000a000
* MFC42 63040000 63160FFF 00121000
* WININET 77210000 772B7FFF 000a8000
* cwbrw 67590000 675B9FFF 0002a000
* MSVCIRT 62E70000 62E7FFFF 00010000
* SHFOLDER 766D0000 766D8FFF 00009000
* cwbad1 677A0000 677A6FFF 00007000
* CWBUNPLA 64BA0000 64BDAFFF 0003b000
* cwbsof 64E00000 64E2EFFF 0002f000
* cwbnl 67630000 67634FFF 00005000
* cwbsv 67580000 67585FFF 00006000
* cwbco 67750000 67754FFF 00005000
* cwbsy 67570000 67574FFF 00005000
* cwbrc 675C0000 675D0FFF 00011000
* cwbunssl 64B80000 64B8DFFF 0000e000
* cwbad 677B0000 677B3FFF 00004000
* cwbbsspi 67760000 6776FFFF 00010000
* cwbbspc 67770000 67781FFF 00012000
* CWBSOMRI 63200000 6320DFFF 0000e000
* cwbodmsg 63210000 63214FFF 00005000
* odbccp32 63230000 63249FFF 0001a000
* cwbcomsg 63250000 6325DFFF 0000e000
* dbghelp 63540000 63657FFF 00118000
*
* Edi: 61C1EABF: 00000020 C8017800 0001AD48 C8017800 0D092848 82F9DD00
* Esi: 637B7FC1:
* Eax: 637B7FC0:
* Ebx: 0000000A:
* Ecx: 637B7FC0:
* Edx: 00000000:
* Eip: 77387EAC: 8440108A 2BF975D2 33F633C6 D85539D2 5BFF8D0F 45290002
* Ebp: 61C1E848: 61C1E85C 7738A8E8 61C1EAAC 66F88B3C 61C1E86C 61C1EB14
* SegCs: 0000001B:
* EFlags: 00010206: 00450042 005F0052 0046004F 0050005F 004F0052 00450043
* Esp: 61C1E800: 016C5E3D 00000000 61C1F4B8 00000000 FFFFFFFF 00000000
* SegSs: 00000023:
* *******************************************************************************
* -------------------------------------------------------------------------------
* Short Stack Dump
77387EAC Module(USER32+00007EAC)
7738A8E8 Module(USER32+0000A8E8)
66F56AC1 Module(cwbodbc+00026AC1)
66F7EA51 Module(cwbodbc+0004EA51)
66F56DC9 Module(cwbodbc+00026DC9)
66F56D44 Module(cwbodbc+00026D44)
66F32EB2 Module(cwbodbc+00002EB2)
66F32BE6 Module(cwbodbc+00002BE6)
62104125 Module(ODBC32+00004125)
621041F3 Module(ODBC32+000041F3)
62D858D8 Module(msdasql+000058D8)
62D8B72F Module(msdasql+0000B72F)
62D8B68F Module(msdasql+0000B68F)
62D8B186 Module(msdasql+0000B186)
62D89A96 Module(msdasql+00009A96)
016C5E3D Module(sqlservr+006C5E3D)
016ABD5A Module(sqlservr+006ABD5A)
01698376 Module(sqlservr+00698376)
01656E53 Module(sqlservr+00656E53)
01E1FE2A Module(sqlservr+00E1FE2A)
010473A7 Module(sqlservr+000473A7)
0103D32C Module(sqlservr+0003D32C)
0103D23D Module(sqlservr+0003D23D)
0103D0C6 Module(sqlservr+0003D0C6)
0102DB52 Module(sqlservr+0002DB52)
0102E0D0 Module(sqlservr+0002E0D0)
0102C5F8 Module(sqlservr+0002C5F8)
010438E5 Module(sqlservr+000438E5)
01041C35 Module(sqlservr+00041C35)
0100889F Module(sqlservr+0000889F)
010089C5 Module(sqlservr+000089C5)
010086E7 Module(sqlservr+000086E7)
010D764A Module(sqlservr+000D764A)
010D7B71 Module(sqlservr+000D7B71)
010D746E Module(sqlservr+000D746E)
View 8 Replies
View Related
Nov 25, 2007
System.Data.SqlClient.SqlError: Cannot open backup device '\.Tape0'. Operating system error 5(error not found). (Microsoft.SqlServer.express.Smo)
i have only one sql instance and tape is istalled successfully.
please help me to find solution for this error.
Thanks,
View 2 Replies
View Related
Jan 29, 2008
I have a really odd one here. We have a production server which is running SQL 2000 Enterprise Edition SP3. It has a number of databases which are backed up nightly. Last night all of the back-up jobs failed with the following error: -
Msg 913, Sev 16: Could not find database ID ##. Database may not be activated yet or may be in transition. [SQLSTATE 42000]
The databases are in good shape - no issues to report. When I run the Agent Job code within a Query Analyser session it works fine.
When I try and re-start the back-up from the Agent Job it continues to fail with the same error.
Any ideas?
View 2 Replies
View Related
Jan 26, 2004
I am using 6.5 .
Here is the error that i get
Think that tempdb is small how do i change that or what is this error about'
--------------------------
AIMSMan
---------------------------
Application-defined or object-defined error 40002
37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Can't allocate space for object '##RevByNetSALIMJUMMA' in database 'tempdb' because the 'default' segment is full. If you ran out of space in Syslogs, dump the transaction log. Otherwise, use ALTER DATABASE or sp_extendsegment to increase the size of the segment.( 1105)
ODBC
I only have data and log device how do i increase the tempdb device
let me know
SEJ
View 4 Replies
View Related
Nov 8, 2006
rajesh writes "Hi All
When i attach my production database i got an device activation Error
cannot
attach database."
View 2 Replies
View Related
Sep 18, 2007
hi, I have a customer that I look after the server for, they have a scanning system that runs with sql server they have started getting the message below despite 30gb of free space any ideas on a fix?
Warning: mkdir() [function.mkdir]: No space left on device in C:InetpubwwwrootDMSadd_external_file.php on line 38
Warning: mkdir() [function.mkdir]: No space left on device in C:InetpubwwwrootDMSadd_external_file.php on line 45 Unable to upload file:C:/office files/Scanning/119129/Estate Agents/SP.pdf
View 8 Replies
View Related
Jul 14, 2015
I am trying to take backup on network folder but I am getting below error:
Msg 3201, Level 16, State 1, Line 9
Cannot open backup device 'xyz.xy.z.xyabcdexyxyzarchive_2015_7_14_11_14_58.Diff'. Operating system error 1326(Logon failure: unknown user name or bad password.).
Msg 3013, Level 16, State 1, Line 9
BACKUP DATABASE is terminating abnormally.
NOTE:- The folder abcde is protected by password , When I try to open the xyz.xy.z.xy, I provide password to connect.
I am using the below script :
DECLARE @filename VARCHAR(255)
SELECT @filename ='xyz.xy.z.xyabcdexyxyzarchive_' +Â
 LTRIM(STR(DATEPART(year, GETDATE()))) + '_' +
 LTRIM(STR(DATEPART(month, GETDATE()))) + '_' +
[Code] ...
How to troubleshoot / resolve this error permanently?
View 8 Replies
View Related
Sep 19, 2007
We are getting an extremely strange SQL CE error 25955 when running some queries on a specific Windows Mobile 5 device in a .NET CF2 application. The app has been tested on a wide range of devices (both WM5 and WM2003), but this error only happens on one of them (details follow).
Error details (SqlServerCeException)
NativeError = 25955
Message = "Unknown error [ float,numeric ]"
(HResult = -2147467259)
SQLCE books online say: token: SSCE_M_QP_BAD_BOOL_OP_TYPE, description: The data type is not valid for the Boolean operation., string parameters: Data type (if known), Data type (if known)
Query details
The following query text fails:
Code Snippet
select X, Y, Z from TableName where KeyValue1 = 79.3 and KeyValue2 = 0This one works (note the absence of decimal):
Code Snippet
select X, Y, Z from TableName where KeyValue1 = 70 and KeyValue2 = 0
DB table details
Column types: X, Y, Z and KeyValue1 are float, KeyValue2 is bit
Composite PK on columns KeyValue1 and KeyValue2
So it seems the SQLCE query processor has trouble matching 79.3 with the float type column, considering the value to be a numeric instead... while that works perfectly on every tested device except this one.
Device model: Mio DigiWalker A701 (WM5 with phone - other tested WM5 devices with phone do work fine)
SQL version: SQL CE 3
Anyone with an idea/suggestion will be most welcome.
Thanks in advance!
simon
View 3 Replies
View Related
Apr 16, 2007
New to VS2005 and I've got a simple WM5 app that runs fine on the emulator, but when I do a deploy to the device and try to run it I get:
'System.Data.SqlServerCE, Version = 3.0.3600.0, Culture = neutral, PublicKeyToken = 3BE235DF1C8D2AD3' or one of its dependencies, was not found.
I have added the *.sdf to the Deploy project and in the dependencies portion of the Deploy project it has the "System.Data.SqlServerCE.dll" listed.
Appreciate any comments or suggestions.
Thanks,
John.
View 8 Replies
View Related
Apr 25, 2007
Here is the error, I receive:
Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'L:Program FilesMicrosoft SQL ServerMSSQLLOGTestDB_Log.LDF' may be incorrect.
Device activation error. The physical file name 'L:Program FilesMicrosoft SQL ServerMSSQLLOGTestDB_Log.LDF' may be incorrect.
Msg 5170, Level 16, State 1, Line 1
Cannot create file 'L:Program FilesMicrosoft SQL ServerMSSQLLOGTestDB_log.LDF' because it already exists.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'TestDB'. CREATE DATABASE is aborted.
Here is my attach script:
USE [master]
GO
sp_attach_db @dbname= N'TestDB',
@filename1 = N'S:Program FilesMicrosoft SQL ServerMSSQLDataTestDB.MDF',
@filename2 = N'L:Program FilesMicrosoft SQL ServerMSSQLLOGTestDB_Log.LDF'
This server has a Raid 5 Disk Array partitioned into three Logic Drives C:, S:, L:. Not sure, why the server was configured this way. If I attach the database with the data and log files on the same logical drive, the DB attaches successfully. When I try to put the data and log files on separate logical drives, it fails. Issue seems to be with the drive partitioning. Any Ideas?
View 4 Replies
View Related
Jun 19, 2006
Basically I've been using Visual Studio 2005 for a few weeks now moving a Pocket PC project from 2003 to 2005. When I hit the Start Debugging Button every time until today the project would rebuild and deploy to my pocket PC allowing me to debug etc but now I get
The remote connection to the device has been lost.
Please verify the device conection and restart debugging.
I used to get this problem in VS2003 sometimes and just like the numerous posts on different sites that I've looked at the problem eventually goes away and I'm none the wiser. One guy said that he found that if he went to bed the problem was resolved when he came back!
My PDA running Windows 2003 2nd Edition is directly connected to my PC via a USB port. I've rebooted my PC and done a soft reset on the PDA but it didn't help. I'm using ActiveSync 4.1.
Does anyone know how to resolve this problem?
View 54 Replies
View Related
Jun 24, 2007
Hi,
Background:
This could be a simple C++ issue as I am not that familiar with the language. I am trying to prototype a small program to test the performance of inserting data using the BCP interface. I want to BCP data that my program generates and passes via program variables.
I have narrowed the issue down to a sprintf call. Following are two variations of the code - one that works and one that does not. The error happens when I try to execute the bcp_sendrow() call.
What is the appropriate way to create / send string data to the BCP interface. Any good examples available? I have created the following from the BulkCopyFromVariables example on the Microsoft SQL Server downloads site.
Thanks in advance, Kerry
---- Works ----
Code Snippet
for(idx=1; idx<=5; idx++){
//sprintf(k1, "%d", idx); //does not work...
sprintf(k1, "oo"); //works....
if ( (SendRet = bcp_sendrow(hdbc1) ) != SUCCEED ) {
printf("bcp_sendrow(hdbc1) Failed");
Cleanup();
return(9);
}
}
--- Causes Access Violation ----
Code Snippet
for(idx=1; idx<=5; idx++){
sprintf(k1, "%d", idx); //does not work...
//sprintf(k1, "oo"); //works....
if ( (SendRet = bcp_sendrow(hdbc1) ) != SUCCEED ) {
printf("bcp_sendrow(hdbc1) Failed");
Cleanup();
return(9);
}
}
--- Additional information ---
---------------------------
Target Table Definition
---------------------------
Code SnippetCREATE TABLE PtTest(
[ID] [int] IDENTITY(1,1) NOT NULL,
[PtID] [int] NOT NULL,
[ParamID] [nchar](10) NULL DEFAULT ((200)), --Above example trying to insert data here via k1 variable...
[ParamValue] [nchar](10) NULL DEFAULT ((200)),
[InsDate] [datetime] NULL DEFAULT (getdate()),
)
----------------------------
-----------------
Bind statements
-----------------
Code Snippet
int idx;
char k1[5];
char *terminator = "