We currently facing the problem to provide an offline version of a Server-Client-App (WCF/Silverlight). On our server we currently working with a heavy weight MSSQL Server, storing global and user data.
Now, to provide an offline version, we have to provide a local database subset. It will have to store a lot of data anyway (probably >6GB).
Now we don't want anyone to be able to modify or even see the db structure and data. But as far as I know, localdb or SQL Express have always the problem, that a local admin with knowledge of sql can open and manipulate the db with sa.
What would your suggestions be?
Related
I have local database with a lot of data for developing a site...now I want to publish this project.
I wanna know. how Can I bring this data from local to online database?
While you haven't specified database, tools, the answer can be extraordinary as well.
Let's imagine that you have local MS SQL DB and Azure SQL db.
There is not a standard method how to do this.
Right click on the database. Generate scripts.
Then select all objects that you need
then go to advanced and change types of data to script to:Scheme and data
as the result you will have full damp of your database that you have to run on AZURE SQL.
ps. more ideas only if you provide more details
That I usually use is Azure and you can publish you app and database to it direct from VS. Of course you can do is separate db or app.
https://learn.microsoft.com/en-us/visualstudio/deployment/deploying-applications-services-and-components-resources?view=vs-2022
I'm working on a desktop app that was developed about 5 years ago using C# and mssql server 2000.
This app uses OPENROWSET to load some xls files, and it worked just fine til the institution in where I work upgraded databases (to something like msserver 2019 or sort of), and OPENTOWSET stop working.
Despite knowing there's plentiful of procedures and recipes to fix this issue (which I cannot apply coz database runs on server), my company's DBA is telling me the only way to fix such problem is to give admin-privileges to the app-user, and he cannot do that because of safety rules - dropping the problem to me. Now I have to replace OPENROWSET with something else.
So the question is: is that true?
There's no way for a skilled DBA to make OPENROWSET work on a remote DB with regular/non-admin user, fixing those errors about permissions and linked servers?
Is OPENROWSET "mature-or-safe-enough" to make it run on nowadays production servers?
It looks like you are attempting to open excel files from within your database. In which case, the default setup would not allow this:
https://learn.microsoft.com/en-us/sql/t-sql/functions/openrowset-transact-sql?view=sql-server-ver15#remarks
OPENROWSET can be used to access remote data from OLE DB data sources
only when the DisallowAdhocAccess registry option is explicitly set to
0 for the specified provider, and the Ad Hoc Distributed Queries
advanced configuration option is enabled. When these options are not
set, the default behavior does not allow for ad hoc access.
When accessing remote OLE DB data sources, the login identity of
trusted connections is not automatically delegated from the server on
which the client is connected to the server that is being queried.
Authentication delegation must be configured.
It sounds like this may possibly have been configured way back in the past for previous databases, but the DBA who now sees this regards it as a bit of a security problem. Whether or not he is right depends very much on how you use this, but it does sound like something that would be better avoided.
It may be better to load the excel files in your C# application and then send the BULK data to sql server to just save.
I opened a thread here:
SQLite Database vs online database C# UWP
but I have a second, more general question that was not answered:
How do I distinguish data of each user from all the others after sync between multiple SQLite files and one SQL server?
I mean, since the SQLite is offline and local db solution, I did not implement any user/password thing.
But since multiple users will be syncing between their Host and Client app via SQL temporary database, I don't know what is the usual technique to achieve this.
My theory is to force host app user for user/password creation and store that data in one of the SQLite tables locally. Then, I should use SQLite-Sync
to pull all current users' data from SQLite and combine it with his specific user credentials.
But, since I never used SQL (only SQLite) I don't know how user management works. Here is my question then:
How do I separate each users' data from the others?
Is the user assigned to each row of data like an additional field in order to distinguish specific users' data?
Or is there a separate table for each user? Or maybe there are different databases for each user? (sorry if my theories are too nooby).
EDIT:
I just had another idea, maybe it is possible to avoid SQL server mediation if I manage to parse user SQLite data directly between the two apps? Something like this: How to do sync with local database and parse?
but in UWP vs Android.
I am currently learning about EF and have come into a scenario where the data should be used in both an online and offline mode.
It is assumed that the user will have to use the system first while connected to obtain the data used offline.
I thought about serializing the queries but IQueryable/ObjectQuery are not marked as serializable.
How would I go about being able to store results from a few queries locally and then restoring them in offline mode so the use can continue to use the app? I could spend days researching this but I hope somebody can point me in the right direction.
EDIT
It is worth noting that the master SQL Server instance is a shared server that has very minimal features installed. Replication for example, is not installed.
Assuming you are using SQL Server, you vcould take a look at SQL server compact.
http://msdn.microsoft.com/en-us/data/ff687142.aspx
You could copy data from your main DB into a locally stored CE database then switch to this for offline.
I'm hoping someone can help me. I recently started the development of a windows form application connecting to a remote sql server database. I was happy enough developing it until a potential client queried if they would be able to buy the whole application but they do not want the application connecting to the db via the internet.
I predominantly develop websites using php/mysql but migrated to c# for this particular project. I'm familiar with sql but not sure what database I should be using if the client wishes to have the whole application on their own computer. I've considered providing the database install as a pre-requisite when publishing the app (although I'm currently not sure how to do that) but I'm having reservations whether that is suitable or could lead to more problems. I want to create an application that can install to a single computer and has little to no need for administration. Could someone advise the best way to approach the data storage in this instance.
Because you have already a SqlServer database operating on your remote site, the best path should be to use the LocalDB version of SqlServer Express 2012. See this link about deployment.
If you don't use stored procedures, views and triggers then also the SQL CE could be an option, but you will not have file binary compatibility and you should work on importing your schema and data.
SQL CE is a compact light weight way of going..
http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx