15,890,399 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11298827 (Top 14 by date)
Member 11298827
9-Nov-21 11:27am
View
Gerry, thanks so much for your reply. I changed the type of 'e' to SKTouchEventArgs, and was then able to easily access e.Location.X and e.Location.Y
Member 11298827
13-Sep-20 18:59pm
View
Gerry, thanks for this thought.
I looked at the System PATH variable and saw the three different paths, one each for V12, V13, and V14.
Using the "Move Down" button I put them in the correct order (V14, V13, V12) so V14 would be found first.
This works great, thanks for the tip.
Member 11298827
25-Jun-20 9:06am
View
GenJerDan,
The file is located in the project folder, and yes, permissions are set correctly. Error message seems to indicate server cannot be found. This all started when I uninstalled SQL Server and then did fresh install of SQL Server Express 2016 (with LocalDB). My application, which is installed on the same machine, also will not connect. I'm thinking it must be a corruption in Windows Registry, but I have no idea how to troubleshoot that. In Regedit I see entries for:
SQL Server
SQL Server 2005
SQL Server 2012
SQL Server 2014
SQL Server 2016
SQL Server 2017
SQL Server Local DB
SQL Server Native Client 11.0
I had 2017 installed at one point, but uninstalled it. 2014 is also no longer installed. I don't want to start messing with the registry unless I know exactly what I'm doing, and I don't.
Member 11298827
24-Jun-20 10:20am
View
Richard,
Thanks anyway for trying!
Member 11298827
28-Jul-19 11:08am
View
Thanks O'Griff, I read the article carefully and then installed SQL Server 2016 Express over the 2014 install. No problems. This question relates to a previous one I posted "Application cannot find DLL file". I will update that one now, so if you could look at it, I would appreciate very much.
Member 11298827
27-Jul-19 15:54pm
View
Update - I tried using "Bundle.Microsoft.SqlServer.SMO" from Nuget, but it made matters even worse - When I install the app on the development PC and try to restore, an exception is thrown - Method not found: 'Void Microsoft.SqlServer.Management.Smo.BackupDeviceItem...
So it would seem the Backup and Restore methods are not in the newer DLL?
One more question - can SQL Server 2016 Express be safely installed over previous versions? I don't want to start uninstalling older versions if I can avoid it.
Member 11298827
27-Jul-19 12:26pm
View
Thanks for your reply - I don't have any experience with Nuget - so after reading about it, I found that it is built into VS2015. I used it to look at the various packages but did not see "microsoft.sqlserver.sqlmanagementobjects" (as seen on Nuget site).
I did see "Bundle.Microsoft.SqlServer.SMO". It is version 12.0.2000, updated 9 months ago. Is that the one I should use?
Member 11298827
20-Jun-19 13:31pm
View
O'Griff, thanks for letting me know that! All testing is complete and it's working well. One thing I want to mention -
It seems the database name is just the complete path to the .mdf file. In your code you hardcode the database name like -
source.Database = "MyDataBaseName";
That doesn't work in my case because the database name (pathname to .mdf) would change depending on the PC the application was running on. So, I changed the RestoreDatabase and BackupDatabase methods to pass in a string holding the pathname. Hope that makes sense, don't know what else I could have done.
Thanks again for all your help. I'm marking your solution as accepted.
Member 11298827
19-Jun-19 20:01pm
View
O'Griff,
So far so good. Question: Your code declares and assigns value to ConnectionString, but I can't see where it is consumed. I commented out the line and it still works (at least the restore function, have not tried backup yet since it was already working in my code). So is this variable needed?
public static readonly string ConnectionString = @"Data Source=GRIFFPC\SQLEXPRESS;Initial Catalog=AudioMaster;Integrated Security=True";
Member 11298827
19-Jun-19 16:05pm
View
O'Griff,
I took your advice and tried your code. It seems to be working!!! Have more testing to do, and maybe more questions for you.
Member 11298827
19-Jun-19 10:09am
View
O'Griff,
Thanks again for the reply. Yes I do have SQL Server installed, but I didn't know if it was being used by the application. I need to be able to install it on other machines, but at this time I don't have access to any other PC to try it.
Reading through your article, I'm a little daunted about trying it. Seems like there are a lot of stumbling blocks. My alternate plan is to just copy the .mdf file to a subdirectory (actually a different drive would be safer). I can to this before I connect to the database, but while connected, the mdf file is locked, and can't be copied. Also it seems the mdf file is not updated until the application closes. Is there a way to get SQL Server to update and release the file after connecting to it? For instance can I disconnect from the database to release the file for copying, and then reconnect to it? By the way, the database is very small and should never grow to more than 10MB or so. I sure appreciate your help.
Member 11298827
18-Jun-19 18:56pm
View
OriginalGriff, Thanks for posting this. Question: does this code require Microsoft SQL Express be installed? As far as I know (but I could be completely wrong) the code I'm using so far does not need SQL Express, it just uses the .Net framework. I really don't know because I'm very new to this. I would like this application to be as portable as possible, so if I can do it without SQL Express that would be the best.
Member 11298827
18-Jun-19 13:49pm
View
MadMyche, Thanks so much for your answer. It makes sense, and I'll try it and get back to you.
Member 11298827
30-Sep-15 13:29pm
View
Thanks for the reply - I am working with the hosting provider to verify the my account is set up properly. From what I can see, it is. To the second part of your comment - I have only one .ASP project on the server, so I don't think there could be a conflict. I think that is what you meant.
In references section of solution explorer I see Microsoft.CodeDom.Providers.DotNetCompilerPlatform being version 1.0.0.0, but runtime version v4.0.30319. In the error message from the server I see:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249.
So is 4.0.30319 the version for .NET Framework (and ASP.NET) or does it refer to the CodeDom compiler? I'm confused.
Show More