Saving user information in wpf c# app - c#

I am creating a c# wpf application that will store users information and allow users to view other users profiles in a corporation.
What would be the best way to store the data that each user is entering in order to have it accessible from a centralized location?
I'm fairly new to creating connections to databases in wpf applications and any push in the right direction would be greatly appreciated.
I've been reading a bit about SQLlite and it seems like it has its pros due to its mobile characteristics but does this mean that the SQLlite database will be local to each user? I need it to be centralized so that data entered from anywhere goes into one database.
Thank you

You could use ADO.net datasets to get the data from the server but this is done by downloading a local datatable and syncing it using a data adapter
connection between client and server
how to do in visual studio

As you stated mobile characteristics are not what you need. As for a central database consider the free SQL Express from Microsoft. You will need some type of security so they can only update their own profile.

Probably one of the more straightforward options is to create an Entity Framework model for your application. This may serve as a primer for your exploration of the topic:
Databinding with WPF
You'll probably find it easiest to develop against your local SQLExpress instance or some other local data store. But the final solution will need to be connected to an enterprise-ready database. Since there was no mention of cost constraints and the nature of this question is more of "how?" versus "what to use?", I see no reason why this shouldn't be a SQL Server solution.
Ultimately, though, this question is rather broad in scope and cannot be adequately addressed in a simple answer here.

Related

Easy way to convert the MS Access database to Web application

As per requirement, we need to convert the existing MS Access database to a web application. Is there any easy way to convert the MS Access database to web application? As of now they are inserting the data to access db using access Forms. User also wish to continue access form feature even if we create new web application for the same. That means user should have the option to access the MS access database through Access forms as well as web application.
Please guide me away to solve this issue.
Best Regards,
Ranish
You can use Office 365 and have somewhat of a web-based application.
https://blogs.office.com/en-us/2012/07/30/get-started-with-access-2013-web-apps/
Or, store Access in SharePoint, but your functionality will be quite limited. Keep in mind, no VBA will run on a web-based application.
The alternative is to use SQL Server Express, and ASP.NET, both of which are free from Microsoft. I'll tell you now, though, the learning curve will be quite steep if you have never used these technologies before. This combo, however, will give you the most control!
You can get the .NET framework from here.
https://www.microsoft.com/en-us/download/details.aspx?id=30653
You can get SQL Server Express from here.
https://www.microsoft.com/en-US/download/details.aspx?id=42299
Four years after and according to this:
https://www.comparitech.com/net-admin/microsoft-access/
still a question for many. Access can be converted to an Web App in almost no time. Particularly Access Forms are super easy to crate with the library like Jam.py.
The process was discussed on Reddit in April 2021:
https://www.reddit.com/r/MSAccess/comments/mj4aya/moving_ms_access_to_web/
I see quite a few Access databases with more than 100 tables, all converted successfully to SQLite3. After inspecting the imported tables via provided link, Forms are automatically created. Which leaves the Access Reports and Business Logic untouched. Reports can be designed in LibreOffice for Jam.py as Templates. Business Logic can be moved from VB to Python, if there is a need to do so.
The SQLite was selected as the default DB for the conversion, since it is very portable. Looks like the converted App can be moved to any DB that Jam.py supports, by Export/Import.
Cheers
First of all, Database and Web Application are not mutually exclusive.
Back to original question, I have done multiple projects like that. A client started with small Microsoft Access database with a couple of user; then they migrate to to web application when they get more traffic.
At first, you want to convert data from MS Access Database to SQL Server. MS Access Database is not meant to access multiple users simultaneously. Then you develop the Web Application which uses SQL server as back end database.
Right before you go live, you convert the data again from MS Access Database to SQL Server very last time. Then do not let them use old MS Access Database anymore.
Easy way to convert the MS Access database to Web application
Most of the time whoever created MS Access database are not software engineer, so table are not normalized and do not have relationship at all. I normally create new normalized database in SQL Server. Then write a small program to convert those data from MS Access to SQL database.
There are generally two approaches with more details covered in this article looking at ways to convert microsoft access to web application
Direct Port means simply a basic migration whereby you port more or less verbatim basic Access forms into a web portal i.e. Microsft Access to a browser-based version as is using a third-party tool. Some of these are quite mundane in that it just allows you to run the Access application inside an internet browser (whoopee!) or can be quite drawn out and then limits you on how much you can change afterward. With even more complex cases requiring a consultant to help you migrate the system. Though it does help to know your user count as the higher you tend to be, the less appealing a third-party porting service becomes due to subscription-based models.
Upsize -the more involved or complex your data structure is an upsize using custom development and splitting the system across web and data tiers might be worth it if
You've got a special process or some secret sauce you're looking to keep.
Likely going to have a significant user count and want to avoid subscription
Inherently cynical or cautious, and want to handle your own architecture and security
Looking for a specific user experience
If you mean how to convert automatically and you want to keep both Access and the Web application (I don't recommend that, I would move everything to the Web app) I would do the following:
Export your Access data in CSV/Excel
Use a platform like DaDaBIK to import the CSV/Excel file and automatically create a Web app based on that file, with data stored on SQL server, MySQL, PostgreSQL or SQLite.
connect your Access to the SQL Server (or Mysql, ...) database created by DaDaBIK, from now on Access will only be used as a frontend.
Now you have a web app created with DaDaBIK and your Access frontend both working on the same DB. As I said I would skip 3) and keep only the Web app, this helps with handling data integrity when two users are accessing the same record.
Depending on how complex is your Access Application (e.g. complex validation rules or custom VB code you added), you could reach your goal without any coding or with some coding.

Apply changes to Database later/manually

Is it possible to achieve this?
Download/fetch data from the database then save locally to a Windows Mobile app for later use (without internet connection).
Make changes to the database locally.
Upload the changes of the local database to update the database from the server manually.
I am thinking about a sync function but I am using an Oracle Database on the server and Oracle DB and SQL Server Compact doesn't support syncing with each other naturally.
Sure this is completely possible, but you are going to need to write the syncing feature yourself unfortunately. You might be able to incorporate this, but as of now there is no bolt-on solution for you, so you would need to add the syncing features.
Happy coding!
Please read about the ADO.NET technology.
It was made for implementation of your scenario - maintaining of disconnected cache of server data.
For example look at this article
And here is more specific example -> Disconnected Architecture in ADO.NET
Here's a great walkthrough from Microsoft on doing exactly this:
Walkthrough: Creating an Occasionally Connected Smart Device Application
Note that it was reported that this technique is not 100% reliable, meaning it can "forget" to post the latest data.
To get around this, you can add a TimeStamp DateTime field to each table that stores the time the latest data was written or updated, then modify your queries to only pull/push the latest records.

Which Database should I use for small network application

I have an application (currently in foxpro) that uses about 12 tables that can be networked.
The tables are related in various ways, but not unduely complex - more like a customer ordering system
I want to rewrite it in C# using MS Visual Studio.
The Application is desktop only but with up to 5 users able to access it at any given time.
The question is which DB should I use?
It needs to be:
Easy to install with the application.
Support sharing from up to 3 or 4 computers
I have looked at SQL Express but the sharing issue looks to be fairly complex and installation for SQL on a server computer is required.
DB4O seems to be for more media rich applications.
I am fairly new to C# (and now getting long in the tooth as well) so I need this to be a reasonably painless way to achieve what I already have in Foxpro.
Some may ask why change - well, there are things that we want to be able to add in the future that would stretch Foxpro too far.
I have spent a couple of weeks researching this and now would really appreciate any help that people could offer.
My policy: If the job can be handled by SQLite (for .NET one option is System.Data.SQLite), use that. On the surface, it sounds like this can.
SQLite is [...] a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.
Just to stir the pot a bit, if you're connected to the internet you could give a SQL Azure Database a whirl.
No server required; multiple connections not a problem; scalable; maintainable; etc. Synch it with a local database later if you change your mind. MS has a 90 day trial run which would probably suit your investigative purposes.
Downsides are well-covered elsewhere, but mainly it's that internet outage renders your app offline.
It's actually not a bad option if you're looking to get your upgrade up and running quickly.
try MySQL, i think there is an easy way to make the database shared along the network (i think it's in the installation process)
mysql... use this driver ODBC drive so that your .NET applications can connect to mysql mysql odbc driver
SQL Server Compact Edition supports multiple clients on the same machine. If you need to connect to the database from multiple computers, you should probably stick with Express Edition.
Have you considered using a Document Database rather than the typical Releationl Databases being discussed here?
One that is very friendly in the .Net space is RavendDB.
Work through this simple "Hello World" tutorial (shows some basic CRUD coding) in Visual Studio to get a feel for how it works: http://ravendb.net/tutorials/hello-world
LocalDB would be a good solution

Synchronize window mobile application with central database?

My requirement is to create a windows mobile 6.1 app [for a window PDA] that works most time in offline, and when it has connection it should work online to synchronize the data from PDA to server and server to PDA to keep the local and central database up to date.
There will be lots of transactions inside PDA and online too.The app will run more than one PDAs. So there will be lots of transactions in every PDA and it should sync with the central server when it is online.
How can I achieve this? Can I use microsoft synch service to do it? or any better other methods to solve it?
Short answer is yes, you can use Microsoft Sync Framework to do it.
However, quoting word to word from microsoft,
The major disadvantages to this solution are:
Changes are required in the central database schema to add columns
and tables that may affect current applications.
Triggers are fired
for each change made to a row, which has performance implications.
Logic for maintaining proper rowversions and row deletions can get
extremely complicated.
Long running transactions can result in some
data being missed during synchronization, resulting in data
inconsistencies.
You are in very much luck if the master database is in SQL Server 2008 though. Read "Challenges of Building an OCA" section in the article because there's no point in pasting everything here :)

What is the best DLL-Base Database for .NET?

I have a Hosting which doesn't support SQL server or any other databse because it is cheap. I know that there are some Dll in which we can add to project and use it as the database.
I wantto know that which one is the best? and is there any other solution to use a database in a Hosting which doesn't support any kind of Database? (don't tell that you can usefile-base database, cause I don't like it)
You could use SQL Server Compact Edition, or SqlLite with a .NET provider (like this one: System.Data.SQLite).
Best might be subjective, but
Microsoft SQL Server Compact 4.0 or Sqlite
SQL Server Compact Edition 4 was updated to enable:
Enabled to work in the medium or partial trust environments in the web servers, and can be easily deployed along with the website to the third party website hosting service providers.
FireBird is also a good choice.
Read more about it.
What is a good embedded database to use with C#?
There is an sql server compact editon if you have no access to a data base server. Also if you host doesn't support databases you can get hosted databases from another provider. Another very popular DBMSless option is Sql light which I have used in c and am sure some one has extended to use in c#.
I suggest you Db4o (Database for objects): http://www.db4o.com
It's an object-oriented database and it works like a charm since it store objects instead of tables and rows, that may be a good choice for you as it'll free you of creating a data access layer, object-relational mapping and so.
Anyway, I'll tell you that if you're going to host data for some multi-user application, any of possible solutions would be a bad choice because you'll have great performance issues.
I would take SQLite over SQL Compact Edition in notime.
So, for small apps, I always go with SQLite.
You have a good (maybe the best) library for C# here as well, you can use a small app to view the database using SQLite Admin
It might interest you:
https://stackoverflow.com/questions/583278/sqlite-vs-sqlce-vs-in-a-mobile-application
and
https://stackoverflow.com/questions/2278104/sql-ce-sqlite-what-are-the-differences-between-them
I'm using SqlLite and happy with it. It works greatly even in cheapest shared web hostings.

Categories

Resources