How do I ensure all processes are done with a SQL database so that I can delete it?

I close and dispose of the sql connection when leaving a form and opening another form. In the new form I identify a sql database to delete. I use a 'System.IO.File.Delete(filepath_file_to_DELETE)
I get a error because the file is being used by another process. How do I make sure I am completely releasing the database when leaving the original form or when loading the next form?
Thanks

Dispose of any SqlCeConnection objects in use by your app and any other apps accessing the same file.
Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

Similar Messages

  • How do I ensure all emails are stored on my iMac even if I open and delete on my iPhone?

    How do I ensure all emails are stored on my iMac even if I open and delete on my iPhone?

    Depends on the type of email account, do you know which yours is, POP or IMAP, if you don't know tell me who is your email provider

  • After I've heard an audiobook downloaded from the public library, how do I delete it from the Shuffle?  When I plug it into my computer, I get a screen showing how much space is left on the Shuffle but no list of files that I can delete.  WRA

    After I've heard an audiobook downloaded from the public library, how do I delete it from the Shuffle to make room for other audiobooks?  When I plug it into my computer, I get a screen showing how much space is left on the Shuffle but no list of files that I can delete.  These books, incidentally do not appear in the ITunes screen.  WRA

    Select the iPod shuffle in the iTunes sidebar (under DEVICES).  If this is a current 4th (or 3rd) gen iPod shuffle, you should be able to see the contents of the shuffle by type, intented under the shuffle's name (still in the sidebar).  Select Music or Audiobooks (not sure where those items from the library will be listed).  The items will be listed to the right, for each category.  Find the items, select, and delete.
    It's on page 20 of the manual
    http://manuals.info.apple.com/en_US/iPod_shuffle_4thgen_User_Guide.pdf
    NOTE:  If this is an 1st or 2nd gen iPod shuffle, select the iPod shuffle in the iTunes sidebar (under DEVICES).  Over to the right, go to the Contents tab, where the items are listed.  Select and delete them from this list.
    I find it more convenient to make a playlist in iTunes with things I want to put on the shuffle.  I then set up automatic syncing (or use autofill) to have iTunes load the shuffle from that playlist, automatically.

  • How do I transfer iMovie 11 EVENTS to an external hard drive so that I can delete them off my macbook pro to make space

    How in the world do I transfer iMovie events from my event library into my external hard drive? There is no option for that. Even when I select "copy" an event, and then go to the external drive and want to paste it, there is no paste option.
    The only time I can transfer footage from the laptop to the backup drive is if I drag and drop an imovie PROJECT file, and along with it click on "copy projects and events"
    But most of my events are not projects, and I just want to move my event videos off the computer.
    I feel like it shouldn't be this hard and frustrating to figure out.

    See:  http://help.apple.com/imovie/#move7d66613
    Geoff.

  • [svn] 4293: Timer usage cleanup to ensure all listeners are fully removed once we' re done with the underlying Timer.

    Revision: 4293
    Author: [email protected]
    Date: 2008-12-11 21:18:10 -0800 (Thu, 11 Dec 2008)
    Log Message:
    Timer usage cleanup to ensure all listeners are fully removed once we're done with the underlying Timer.
    QA: No
    Doc: No
    Checkintests Pass: Yes
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Channel.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicConsumer.as

    Revision: 4293
    Author: [email protected]
    Date: 2008-12-11 21:18:10 -0800 (Thu, 11 Dec 2008)
    Log Message:
    Timer usage cleanup to ensure all listeners are fully removed once we're done with the underlying Timer.
    QA: No
    Doc: No
    Checkintests Pass: Yes
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Channel.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicConsumer.as

  • Error during printing: Ensure all parameters are defined

    Forum,
    I have the following issue on 8.81 PL08. When trying trying to print from the Outgoing Payment screen we get the following message: Error during printing: Ensure all parameters are defined.
    What parameters specifically would it be referring to?
    Regards,
    Juan

    Hi,
    IS the error occurred only in outgoing payment? or what changes have you done?
    Try to create new PLD copy from system PLD then edit the field.
    Everytime you inserted a fields try to run the PLD so that we can determine the problem.
    Thanks.
    Clint

  • Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects obtained from them, but not before.

    I have develop a custom solution for SharePoint Foundation 2010 that provide PDF documents filled with lists data and attachemnts.
    If the Customer run the solution to get the PDF we found in the ULS log following entry:
    03/07/2014 12:07:20.69  w3wp.exe (0x0B10) 0x18EC 
    SharePoint Foundation General                        90hv Unexpected 
    Detected use of SPRequest for previously closed SPWeb object.  Please close SPWeb objects when you are done with all objects obtained from them, but not before.  Stack trace:    at Microsoft.SharePoint.Utilities.SPUtility.GetLocalizedString(String
    source, String defaultResourceFile, UInt32 language)     at Microsoft.SharePoint.SPFieldCollection.get_DisplayNameDict()     at Microsoft.SharePoint.SPFieldCollection.GetFieldByDisplayName(String strDisplayName, Boolean
    bThrowException)     at Microsoft.SharePoint.SPFieldCollection.GetField(String strName, Boolean bThrowException)     at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowException)    
    at Microsoft.SharePoint.SPListItem.get_Item(String fieldName)    
    at ECM_PDF_Excel.ListClicked.GetECOs(Dictionary`2 searchedEC... e918ecd4-7ed6-44bb-9e4f-d764586a2f79 ...RECONumber)    
    at ECM_PDF_Excel.PDF.Create()     at ECM_PDF_Excel.Layouts.ECM_PDF_Excel.ECMPDFExcel.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext
    context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 f... e918ecd4-7ed6-44bb-9e4f-d764586a2f79
    03/07/2014 12:07:20.69* w3wp.exe (0x0B10)                        0x18EC SharePoint Foundation        
     General                        90hv Unexpected ...lags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr
    managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32
    flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)   e918ecd4-7ed6-44bb-9e4f-d764586a2f79
    We check the method
            /// <summary>
            /// Returns the ECOs in a Dictionary: ECO Number, Suffix
            /// </summary>
            /// <param name="searchedECRECONumber">Dictionary, with the search ECR/ECO Number</param>
            /// <returns>Dictionary ECO Number, Suffix</returns>
            public static Dictionary<string, string> GetECOs(Dictionary<String, String> searchedECRECONumber)
                SPSite siteContx = SPContext.Current.Site;
                SPWeb webContx = siteContx.RootWeb;
                Dictionary<string, string> listECOs = new Dictionary<string, string>();
                string ecoNumber = string.Empty;
                string ecoSuffix = string.Empty;
                if (searchedECRECONumber.ContainsKey(ConstantData.listClickedECONumberDictionary))
                    ecoNumber = searchedECRECONumber[ConstantData.listClickedECONumberDictionary];
                else
                    return listECOs;
                // Ich suche die ECO Nummber bei gegebener ECR Nummer
                // Ich brauche den Listen Namen der in den Spalten Realtion ECR Number & Realtion ECO Number einen Wert hat
                SPList dataList = webContx.Lists.TryGetList(ConstantData.listName_ECMExcelTemplateDataLists);
                if (dataList != null)
                    SPListItemCollection dataListItems = webContx.Lists.TryGetList(ConstantData.listName_ECMExcelTemplateDataLists).Items;
                    foreach (SPItem dataListItem in dataListItems)
                        Object relationECRColumnName = (String)dataListItem[ConstantData.listFieldName_ECMExcelTemplateDataLists_RelationECRNumber];
                        Object relationECOColumnName = (String)dataListItem[ConstantData.listFieldName_ECMExcelTemplateDataLists_RelationECONumber];
                        if (relationECRColumnName != null && relationECOColumnName != null)
                            // Ich habe den Listennamen gefunden in dem Spalten Realtion ECR Number & Realtion ECO Number einen Wert haben
                            string searchedListName = (String)dataListItem[ConstantData.listFieldName_ECMExcelTemplateDataLists_Title];
                            string searchedECOSuffixColumnName = (String)dataListItem[ConstantData.listFieldName_ECMExcelTemplateDataLists_RelationECONumber];
                            // Get the List from variable listName
                            listECOs = GetECOsDictionary(searchedListName, searchedECOSuffixColumnName, ecoNumber, relationECOColumnName);
                return listECOs;
    - What take we wrong?
    - How can we avoid this message?
    Regards
    Jonnyenglisch
    Ralf Happe - Christobal Colón N° 1 ES 07670 Portocolom Tel.: +34 6961 0375 7 @: [email protected] Skype: ralfhappe msm: [email protected] www.ralfhappe.com ralfhappe | soluciónes

    Here the code of GetECOsDictionary:
             /// <summary>
            /// Fill the dicionary with related ECO Numbers/Suffix
            /// </summary>
            /// <param name="searchedListName">String: the name of the list</param>
            /// <param name="ecoNumber">String: the ECO Number</param>
            /// <param name="relationECOColumnName"></param>
            /// <returns>Dictionary</returns>
            private static Dictionary<string, string> GetECOsDictionary(string searchedListName, string ecoNumber, Object relationECOColumnName)
                SPSite siteContx = SPContext.Current.Site;
                SPWeb webContx = siteContx.RootWeb;
                Dictionary<string, string> listECOs = new Dictionary<string, string>();
                SPQuery oQuery = new SPQuery();
                oQuery.Query = "<OrderBy>" +
                                    "<FieldRef Name='" + "Title" + "' Ascending='TRUE'></FieldRef>"
    +
                                "</OrderBy>" +
                                "<Where><BeginsWith>" +
                                    "<FieldRef Name='" + "Title" + "'/>" +
                                    "<Value Type='Text'>" + ecoNumber + "</Value>" +
                                "</BeginsWith></Where>";
                SPListItemCollection searchedListItems = webContx.Lists.TryGetList(searchedListName).GetItems(oQuery);
                foreach (SPItem searchedListItem in searchedListItems)
                    // Wenn die geclickte ECO Nummer gleich der Listen ECO Nummer ist dann setze die gefundene ECO Nummer
                    string foundECONumber = (String)searchedListItem[relationECOColumnName.ToString()];
                    string[] splitECONumber = foundECONumber.Split(ConstantData.splitBy_Slash);
                    if (ecoNumber == splitECONumber[0])
                        ecoNumber = splitECONumber[0];
                        if (splitECONumber.Count() == 1)
                            listECOs.Add(foundECONumber, "0");
                        if (splitECONumber.Count() > 1)
                            listECOs.Add(foundECONumber, splitECONumber[1]);
                return listECOs;
    Ralf Happe - Christobal Colón N° 1 ES 07670 Portocolom Tel.: +34 6961 0375 7 @: [email protected] Skype: ralfhappe msm: [email protected] www.ralfhappe.com ralfhappe | soluciónes

  • ITunes:  I just redeemed a gift card in iTunes and then rented a movie.  I want it charged to the gift card but think that it was charged to my credit card.  How do I ensure the charges are against the gift card?

    iTunes:  I just redeemed a gift card in iTunes and then rented a movie.  I want it charged to the gift card but think that it was charged to my credit card.  How do I ensure the charges are against the gift card?

    I took this straight from the help menu.
    You need to set up an Apple ID for use with the iTunes Store before you can redeem anything in the iTunes Store. You don’t need to enter credit card information to redeem only the amount of a gift certificate or card.
    Hide 
    Use an iTunes allowance, gift certificate, or iTunes Gift Card
      If you aren’t already signed in to the iTunes Store, choose Store > Sign In, or click Sign In at the top of the iTunes Store window. 
      Below Quick Links, click Redeem, and follow the onscreen instructions.
    The amount in your account appears to the left of your account name. When you click the Buy button to make purchases, the amount changes to show how much money remains in your account.
    You can use a gift certificate only in the iTunes Store for the same country in which the certificate was purchased.

  • Main thread should print "ALL jobs are done "

    how does main thread know all child threads has finished their jobs ?
    i want my main thread should print "ALL jobs are done "
    my problem is threads does their own work .

    Add all threads to a ThreadGroup, and then let themain thread check the active count of the thread group
    will u convert it into code ?Just read the API: Thread, ThreadGroup. Especially the part about the Thread constructors taking a ThreadGroup as an argument...

  • How to get the all process orders and outbound deliveries based on material

    Hi Team ,
    I need one help from you regarding the MB 56 transaction.
    My doubt is : How to get the all process orders and outbound deliveries based on material, plant and batch?
    Please help me regarding this.
    Thanks & Regards,
    Srikanth.

    Hi,
    You can use ST05,to trace the program and find out,
    hope it will help you...
    thanks and regards,
    veera.

  • Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects obtained from them

    HI
    i am keep seeing this message in ulsviewer of splogs in a webfront end server
    Detected use of SPRequest for previously closed SPWeb object.  Please close SPWeb objects when you are done with all objects obtained from them, but not before.  Stack trace:  
    at Microsoft.SharePoint.SPWeb.get_Exists()   
    at Microsoft.SharePoint.WebControls.CssLink.OnLoad(EventArgs e)   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
    at System.Web.UI.Page.ProcessRequest()   
    at System.Web.UI.Page.ProcessRequest(HttpContext context)   
    at ASP._layouts_icc_icc_scan_view_aspx.ProcessRequest(HttpContext context)   
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)   
    at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)   
    at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)   
    at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)   
    at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)   
    at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)   
    at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)   
    at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
    adil

    Hi,
    Your SPweb object is not disposed properly.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/3a25eb86-8415-4053-b319-9dd84a1fd71f/detected-use-of-sprequest-for-previously-closed-spweb-object-please-close-spweb-objects-when-you?forum=sharepointdevelopmentprevious
    http://sharepoint.stackexchange.com/questions/50793/detected-use-of-sprequest-for-previously-closed-spweb-object-after-spquery
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Is there a fix to touch not working? All updates are done. Intermittent problem

    Is there a fix to touch not working? All updates are done. Intermittent problem

    Do a reboot by holding both the power and home buttons until the apple logo appears, ignore the red slider if that appears.
    If that does not help, take it to an Apple store genius bar and have the techs check it out to make sure there is not a hardware issue.

  • What are the process are done in compile time?

    what are the process are done in compile time?

    if this process occur in runtime that's called
    runtime polymorphismExactly. That's usually the case, especially with interfaces. I'm not entirely sure, but I think if you're calling final methods, those are statically linked because they can't be overridden anyway. I guess it saves a method table lookup at runtime.

  • Is there a way to adjust the settings on launchpad so that when I swipe into it all the open apps/pages are fully separated (like in exposé) so that I can fully view all of them simultaneously?

    Hi Apple community,
    This is my first go at this so be kind,
    My question concerns launchpad. Coming from Snow Leopard I had been using spaces. I like to keep certain bundles of programs on separate desktops, for example all word processing related tasks in one place. I have set up the equivalent on Yosemite.
    My problem is concerns the loss of exposé. Now I know when you swipe into launch pad you get a very similar effect but the issue I am having concerns the "zoom out" effect when you swipe into launchpad. With exposé all open apps/pages etc would be fully exposed - in my case several (sometimes as many as 9 word documents). What I am running into is when I do this in / into launch pad the "pile" of docs is exposed but they are still overlapping so I can't get a good look at which is which and visually identify where I want to navigate to.
    My question is this; Is there a way to adjust the settings on launchpad so that when I swipe into it all the open apps/pages are fully separated (like in exposé) so that I can fully view all of them simultaneously? If so, instructions on how to do so would be greatly appreciated. Any alternative suggestions to doing this outside of launchpad are also welcome. If there is an exposé app for example, I would be quite willing to go that route.
    My main concern is being able to quickly (ie a touchpad gesture) expand all the open pages so I can bounce between them.
    Much thanks from a loyal Apple friend.

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • HT204053 How do I create an Apple ID for my kids which are linked to my Apple ID so that they can make purchases without me having to tell them my user/password?

    How do I create an Apple ID for my kids which are linked to my Apple ID so that they can make purchases without me having to tell them my user/password?

    Welcome to the community.
    Unfortunately, you cannot do that. The first hurdle that you are going to face, is that mobile devices, by virtue of being prone to loss, will always require that a password is entered before a purchase of any kind is made.
    If your concern about the password, is related to your privacy in regard to your mail, contacts and calendar information rather than their acces to make purchases, then the best solution would be for you to use another Apple ID for iCloud.
    Apple have called the whole cloud thing iCloud, there are a number of features under the iCloud umbrella, some of which require their own login. iTunes is one of these, another is what Apple have unfortunately also called iCloud too.
    You can use the same Apple ID (account) to login to both iCloud and iTunes, but you don't need to and often users will login to each service using a different ID.
    The part that you need to remember is that the services available when you log into iCloud are completely different and unrelated to those when you log in to iTunes. Your iCloud login enables mail, contacts, calendars, find my phone, Back to My Mac, Documents & Data sharing and photostream, it does not affect any of your iTunes services.

Maybe you are looking for

  • PDF text does not display properly

    My coworkers made a PDF (using Acrobat Pro and MS Office on Windows) that displays properly in Windows, Mac, Android, and iPad (iOS 6). However, on two different iPhones (v3 with iOS 3, v4 with iOS 5) the PDF displays with no text and only black grad

  • Assertion failed when open Applet in Internet Explorer 7.0 ( Windows Vista)

    I have a problem when loading an applet ( calling from a ASP.NET page ) only in 1 computer ( the others in my company is fine ) Here is capture of the error dialog i got : http://img134.imageshack.us/my.php?image=editorproblemszx1.jpg I try to re-ins

  • IMovie HD saved project in older version of iMovie.  Now can't open/find it

    Working on an iMovie HD slideshow. Saved it although had a warning that older versions could not open it. Since I only have iMovie HD, I assumed no problem. Now I cannot open the file. Received WARNING ' The project "___" was saved with an older vers

  • Keynote slides printing puzzle

    I've done a lot of work on Pages over the years, but I'm really inexperienced with Keynote. I want to print some slides (actually web site pages) from a presentation and have each one fill a single 8.5x11 page. I've read Keynote Help – re: Printing S

  • Best way to migrate using Time Machine backup

    My wife has an '08 iMac. I think it originally had Leopard. Along the way I updated it to Snow Leopard and then Mountain Lion. It also has an external USB hdd and we've used Time Machine to backup to it since we've had it. We just picked up a new iMa