Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 months ago.
Improve this question
Thank you for checking my code
No matter what I do, the record is not saved, it does not give any error
I copied the database file from another project to the root of my project
I have a function called fill, which then saves the information from the select database, the moment I save it, it displays the new record in the datagrid, but when I open the program again, it does not show the record, and when I check the table itself, nothing is saved.
This is my code :
Dim con1 As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|anbar.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
con1.Open()
Dim com As New SqlCommand("INSERT INTO tblcustomer(name)Values(#name)", con1)
com.Parameters.AddWithValue("name", txtName.Text)
com.CommandType = CommandType.Text
com.ExecuteNonQuery()
con1.Close()
Thank you for your advice.
The question in the comments is relevant: what value is returned ExecuteNonQuery? I'm confident that the answer is going to be 1, which means that everything is working exactly as it's supposed to and you just don't know how local data files work.
When you add a data file to your project - MDF, MDB, ACCDDB or the like - it becomes a source file, i.e. part of the project. When you build your project, the compiled EXE is saved to the output folder and the data file is copied there too. It is that copy that your app connects to at run time.
By default, the source file is copied to the output folder EVERY TIME you build your project. That means that if you run the project, make changes to the database, stop the project, make a code change and then run the project again, your database changes will be overwritten, like you never made them.
It's important that you have these two copies of the database because you don't want to have to clean all your test data out when it comes time to release the application. You want to just build and get a clean database, which is exactly what happens.
The solution to your "problem" is to select the data file in the Solution Explorer, open the Properties window and change the Copy to Output Directory property to Copy if Newer. That way, the working data file in the output folder will only be overwritten if you have made changes to the source file. That way, changes you make to the database will persist until you change the source data, delete the working data file or change that property again.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I've developed a console application that does a lot of routines, but the Antivirus detected it as a malware of type Gen:Variant.Ursu.56053.
How can I fix this without touching the antivirus policy because it's not allowed for us to create any exceptions for any found threat.
I'd like also to mention that If i changed the assembly name the antivirus is no longer consider the new file virus, but it looks that it considers it virus because I invoke it many times, with different parameters.
Any suggestions, I'm really suffering from this,
I know this thread is very old, but for people which will come here - to fix this issue simply add icon to the program, im not even joking, it works.
FALSE +VE ALERT!!! Many antivirus engines have name pattern matching as their Swiss-knife to detect malicious files,If any of them matches the name they have in their Database then you can't do much about it. Its simply became a False +ve !!! Also your assembly name should consist of the technology area and component description, or company name and technology area (depending on your preferance). So try changing it to more specific one. :)
Assuming that you are talking about .NET (with relation to Visual Studio) For Ex:
Project: Biometric Device Access
Assembly: BiometricFramework.DeviceAccess.dll
Namespace: ACME.BiometricFramework.DeviceAccess
I had the same problem with Bitdefender, but mine is a Gen:Variant.Ursu.787553 when I tried creating a .exe file from my C program.
I simply moved it out of quarantine manually, and it worked well. You might have to that every time you build a new program. Hope this helps!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am running a VBA Macro in solidworks that stops working and requires me to restart Solidworks after exactly 478 loop-itterations every time I run it.
Inside my loop, I open an STEP file, verify it, and then save it as an STL file. It appears as if Solidworks is struggling to open more than a fixed number of files in the same session.
My plan was to write a VB.NET script outside of Solidworks that can automatically restart the application without my intervention every X number of ittwerations, so I can process the thousands of files I have without my intervention.
VB.NET console script that closes and reopens Solidworks for me, whenever 477 itterations are reached, and then continues the macro from where it has left off.
The folders with my files are numbered, e.g.
c:\data\0\file.STEP
c:\data\1\file.STEP
c:\data\2\file.STEP
...
c:\data\20000\file.STEP
Specifically, I am looking for the VB.NET code that does the following:
Open Solidworks
Call an existing Macro-Script (possibly set a variable that lets me continue where I left of processing the data)
Close Solidworks
1) first you need to open solidworks and the file you want to process:
Open Assembly Document Example (VB.NET)
http://help.solidworks.com/2017/english/api/sldworksapi/open_assembly_document_example_vbnet.htm
2) you will need the openMacro2 function.
Here is a link with an example
https://forum.solidworks.com/thread/79502
3) then close all documents with the
CloseAllDocuments Method
http://help.solidworks.com/2017/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISldWorks~CloseAllDocuments.html
4) then exit solidworks with the ExitApp Method
https://help.solidworks.com/2017/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISldWorks~ExitApp.html
note: if you installed the api module you will find all needed examples in the apihelp.chm file which is located by default in:
C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\api
I took the liberty choosing version 2017 since you didn't mention the version you are using. But all examples should work on later versions too. If you are on an earlier version and you cannot find for instance openDoc7, then look at openDoc6 or openDoc5... until you find the number that is available on your system.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I'm just going crazy about this but I can't find a solution so I'm here to ask for a help.
I've always used Notepad++ but since I've updated to Windows 10 it started not working.
When I open it N++ takes a long time (like.... A LONG time) to be operative (in the meanwhile it stays in "Not Responding").
When finally it unfreezes and I open a file, no text is shown BUT if I try to copy something and paste it somewhere else it does it correctly so I guess it's not a problem of encoding of stuff like these.....
I've tried many times to uninstall N++, clear all the files on the HDD and even eliminate registry keys but when I install it again nothing changes....
I'm desperate please help me!!!
I started having this issue too recently, and found that I had opened up a text file on my network at work, made some changes but hadn't saved it. Then when I got home (where I didn't have access to the network) Notepad++ opened really slow...
Some ideas to try to identify the problem:
Make sure you don't have any file loaded before closing notepad++. Specially files on net shares
If using the project tree Window (Folder as Workspace), try to close it. Specially if you have a huge workspace
Check executable compatibility mode. Is it changed?
Disable any 'check for updates' option (this includes notepad++ check for itself and also all plugins that have a similar option)
Uninstall/disable any notepad++ plugin
Try with a portable version. On the notepad++ site there are both installers and zip packages
Try with 32bit and 64bit versions
Try to delete this folder: "%APPDATA%\Notepad++" (maps to C:\Users\YOUR_USER\AppData\Roaming\Notepad++)
Try to temporarily disable the antivirus. Or add some exception to the path of Notepad++/Notepad++ portable
Create a clean new user and run it from there. Perhaps this is something wrong with some registry keys, so a clean state could work
The official site is here. (Just in case you downloaded it from elsewhere)
I was looking for a solution earlier and it seems like I fixed it myself by updating the application manually (even though "auto-updater" was on). Now the startup times are greatly improved.
Go to Plugins -> Plugin Manager -> Show Plugin Manager. Click the "Updates" tab. Hit the Update button and restart the application until your list of obsolete components / plugins is empty.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
When I create my second core data model and run the application everything is fine. But when I modify the second model, application is crashed, and I have to delete my app and run again. Is it normal? When I put my application's second version into the AppStore will it be OK or not?
This is expected behavior. You have altered your Core Data Model, and when you attempt to run the new model over the existing one in your previous build, it can't figure out how to migrate the old store to a new store with the new model; this is called a migration. A lightweight migration (meaning you don't have to write any custom migration logic) can be performed as long as you version your model for every set of model changes. When changes are made within a version and you install over a previous build, the migration fails and your app crashes.
For working in the simulator, it's normal to reset content and settings very often when messing with your core data model, but when shipping to the store, it's very important to be aware of model versions. Once you ship with Model Version 1, no more edits can be made to that model version. As soon as you ship with model 1, go ahead and create a new model that you can edit freely until your next ship date. Do this by selecting your xcdatamodelId file, and selecting Editor -> Add Model Version. The "based on model" is your current model. Once this is created, select your xcdatamodelId file again and in the file inspector, make sure you new model version is selected under the heading Model Version.
Doing this will allow you to use lightweight migrations and stop your crashes, and you data will migrate from your old store to the new one on installing an update. Read here in the docs for more!
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Yesterday I had a huge problem - suddenly my cocos2d project stopped compiling. You can read the story here: My cocos2d project stopped compiling! Over 40 errors! What to do?
Apparently something changed the folder name and it was the reason. I have made a new project, copied my files into it, verified that everything worked, made a snapshot and zip backup and went to sleep. Now when I did a small change to code and compiled it for simulator it worked.
But when I tried to compile it for device I got same 40 errors.
This is really killing me.
I use ARC-enabled cocos2d project.
If you want to check it out yourself here is the project - https://www.dropbox.com/s/eic1llpri6x6akt/BusterballBackupV1.0.zip
Restoring snapshot or from zip file didnt help either.
I think the problem might be with that:
When you look on the pane to the left of Xcode where you see your project layout there is a folder named Products. It contains two items in it - app itself and libcocos2d-library.a.
When I checked out fresh template they are black and have some strange path in the depth of xcode. But after I add files they go red and lose paths. What can be done about that? I cannot find that file (libcocos2d-library.a)
The problem is caused by the configuration of the static library target. The option "Always Search User Paths" should be set to NO. Here are the steps:
Choose the target cocos2d-library
In the right side, choose the Build Settings,
Find Always Search User Paths and set it to be NO
Build the project. It should be OK. The xCode version I used is Version 4.4 (4F250)