Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
cannot delete sdf file of sql server ce connection
May 27, 2011
I have below statement for sql server ce connection. When delete the sdf file, it prompt error:
The process cannot access the file 'C:\Documents and Settings\xxx\My Documents\StockTake.sdf' because it is being used by another process.
Dim conn As New SqlCeConnection
conn.ConnectionString = "Data Source=" & DIR & stocktakefile & ";Persist Security Info=False"
Dim cmd As New SqlCeCommand("select * from stocktake", conn)
Dim reader As SqlCeDataReader
reader = cmd.ExecuteReader()
System.IO.File.Delete(Dir & stocktakefile) // Cannot delete???
Posted Date: May 27, 2011 Points: 20
Make copy always property of that sdf file to true.
Hope it helps.
To post reply
Related Questions Related Questions
How to copy a file from server to local system
SQL 2000 Connection string problem on hosting server
dynamic sql connection string in web config file
delete specific file from folder in vb dot net
saving file in sql server
delete backup files in sql server
Getting error while opening file at windows server 2008 R2.
Sql Server connection error
save file in server
Upload the file into server
Latest Forum Questions From The Same Category
Security Patch KB2898851 - VB6 application is not working
Automatic Insertion Of Record From one table to another by checking the Date.
unable to type values in datagridviewtextboxcolumn
i am a starter to asp.net
Vb.net Program ending Suddenly
VB.net-create session to call sql data table from diffrent part of image
Looping through access datatables and compare values to get conflicting data
Option Explicit vs Option Inter in VB.net
List info of all Mobile devices & Select COM Port for a device
exception while iterating through the records
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend