Data Migration - SQL Server - c#

I have a problem with a data migration. I will try to give all the information to help me solve this situation. A little of history:
In 2005 an internal website was developed to help manage its business. Due to the latency and change of business rules a developer was hired in 2019 to put "order in the house" (me). When I got the website I was not given the source code, without thinking twice I performed a platform from scratch in C#. All right here, everything was a success. The problem then arose in data migration.
The most important thing to keep, was the files (pdf, .xsd, etc). I then picked up the data from SQL Server 2005 (old website) to SQL Server 2017 (new website).
The content of the files on the old website was in the data type of 'IMAGE' and after research I found it better to put in the new website as 'VARBINARY'.
With the data all migrated, on the new website when I have downloaded the file I get the following error message:
Adobe Acrobat Reader could not open 'file_name' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)
I do not know if it helps but for example, if I insert a file normally on the website its download works correctly. The field is that it behaves differently (the first was the one inserted by the website and the others came from the migration).
This is a print screen of database:
http://prntscr.com/mwilex
Does anyone know why the error? Has anyone ever come across a similar situation?
Bst: I run a query [SELECT SERVERPROPERTY('Collation')] and the output of the two Databases are the same, 'SQL_Latin1_General_CP1_CI_AS'

Related

How to connect to LocalDB in a .NET 5 project?

I am writing a console application using .NET 5, and I am using a LocalDB instance (at least I hope that's the right terminology) to store the data that the application needs. I can see the database (including both tables and all the data in said tables) in both the Server Explorer and SQL Server Object Explorer tabs of Visual Studio 2019, but the Data Sources tab the only thing that shows is the text "This window is not supported for the selected project."
The problem is, all the tutorials I've been able to find rely on that Data Sources tab. From looking at other questions here on Stack Overflow, it looks to me like that tab is deprecated with .NET 5? Am I correct? And how would I write the code to access the database and perform CRUD operations without the Data Sources tab?
Sorry if this is a stupid question; this is my first time using LocalDB.
You should use SQL Server Object Explorer. If you right click on the database that you want to connect, you can see the properties, including connection string. If you have trouble with incorporating Connection string into your code - you need to show the code and the problem.
Whether Data Sources is deprecated or not, as you can see it is not supported for most projects (I think it's just for Windows projects - but I may be wrong). Anyway - you don't need it. And by the way - this approach works regardless of the database you use (LocalDB, SQL Express or regular SQL Server)

Exclude Oracle website from search engines?

I'm a C# developer and last year i took over some projects at work, which are websites made completely in Oracle. I have 0 experience with oracle.
Suddenly the websites are visible on Google, which they are not supposed to...
Can anyone help me how to avoid that?
I know about "robots.txt" but i don't know where to put it in Oracle. We're having a hard time finding the root.
Does Oracle have a special way to fix this? or does anyone know any alternate solutions?
It's all located on a subdomain, if that's any help.
I suppose, there is some Oracle CMS in use, like WebCenter Content. Any CMS, not only any one by Oracle has inbuild metadata management. If even not, there should be any access to an engine, which generates HTML from database or XML content.
What i would do - i would search for something in the backend of the Oracle CMS, where you can manage metadata of each web document. After you got it, add to every web document's meta data the robots meta tag <meta name="robots" content="noindex, nofollow">. Thats it.
In case the content of web documents is saved in the database, find a table with the content of web documents - if their heads are saved in the database separately - find them. Then run an INSERT query into each row of this table, with the meta robots tag i wrote above.
I can imagine, after INSERT query you will be forced to re-render all web documents - do it to make new head content appear.
Another way to go could be to create X-Robots-Tag on your webserver (if there is any Apache or Nginx between your Tomcat and the web) and put into X-Robots-Tag the "noindex, nofollow"-rule. Whether Tomcat (or the like) supports X-Robots-Tag or similar - i don't know.

Mysql database alternatives if Mysql isn't an option

I'm working on an app using Unity. This app is supposed to upload certain simple information at specific points, which is why my original plan was to just connect it to a Mysql database. Unfortunately Unity doesn't support the NET 4.0 framework and nothing I've tried seems to work.
Yes I could use PHP scripts hosted on my web server to add and pull information, but I'd rather do it all from the app itself if at all possible.
The data I need to record is pretty simple, IDs, ints, strings, nothing too complex.
So I'm now trying to look into alternatives to Mysql.
JSON
So far I have gotten SFTP to work (By using the Renci.SshNet library) and the app is now uploading files in my server's home directory. So my original idea was to just create JSON files with the data and edit them remotely.
Is this something that could be done with C#? How? Any specific resources?
The alternative to remote editing would be to download the JSON file, edit it locally, and then upload it again, but that doesn't sound like a very smart idea.
I have found this answer but it's unclear to me if it requires to send the whole JSON file to the server after every edit or if it's possible to just edit it from the app. Some clarification would be great.
SQLlite
I've also looked into SQLlite but I'm also unsure if it could be remotely edited.
I've Googled it multiple times but can't really find any useful information.
What are my options at this point? What should I use if I needed the equivalent of a Mysql Database that can be remotely edited and read?
You can start seeing into Google Firebase project
https://firebase.google.com/docs/database/unity/start
But unity 2018.3 does support Net 4:
https://learn.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017
https://blogs.unity3d.com/es/2018/07/11/scripting-runtime-improvements-in-unity-2018-2/
https://blogs.unity3d.com/es/2018/03/28/updated-scripting-runtime-in-unity-2018-1-what-does-the-future-hold/

Online and Offline synchronization of a MongoDB

I have a project with three other colleagues, that consists of basic forms (with pictures stored in it) who should be customizable.
The app is developped in c#, the problem is that it musts have to work in offline mode sometime. All the data were supposed to be stored in BSON documents until a connexion is disponible, but we recently learnt that there should be pictures in the form, and so we have to use gridFS and that is much more complicated.
I would like to know what you would do?
I thought of installing a mongo on the client et replicate on the server, but I think that would be problematic if there are more than one client, or serializing the picture in only one file, or even find a system like SQLite if it exists for mongoDB.
All ideas are welcome !

Using a local database

I'm busy writing a small app and I only want a database to load small amounts of data, in other words I don't need the functionality of SQL.
So I've installed filehelpers, but it seems very limited in the sense that I can read/write and even append data, but it seem impossible to delete one row of data in a table?
Does anyone know how to do this with filehelpers or point me to a different solution where I can just add a local db to my app without any other external software required?
PS. My visual studio does not have the "create local db" from the item selection.
For something like this, I'd use an embedded SQLite database. It gives you the best of both worlds, one file database for local data and most of the features of SQL.
See here: https://sqlite.org/
On their download page, they have lots of stuff and a plugin for VS:
https://sqlite.org/download.html

Categories

Resources