I am working on a Winforms application in C# using .NET 6.0.
The application has a SQL Server database with four tables. I have completed it and created setup.exe which successfully installs the application on my computer and works perfectly with the SQL Server Express database.
However, when I install it on another computer, I have problem to establish and connect database. I followed several instructions with no success. I even changed platform to .NET Framework 4.8 and followed tutorial to create localDb.
It works fine if I have only one table and one form with datagridview which follows table from database. But when I try interaction with other forms and tables it does not work.
It seems to me that only way is to install SQL Server Express on another computer and create the same connection string and same table, which I believe could not be the truth.
I saw a number of questions addressing the same problem, but there is no answers that solve it. I would be very thankful If anybody could suggest tutorial or article which addresses this topic.
Related
I'm working on a school project and I'm almost done. I created a C# website with different functions for different users.
I tested my website several times on my local machine and it works fine, even logging in with Google+ api etc works as it should.
But recently I uploaded my website to an ASP.net host (it's a free host, not Azure) and tested my project. Unfortunately signing in or registering both didn't work.I did some research and found out you have to link your C# project to an online database (I know it's stupid but I honestly didn't know). So I ordered a free external SQL server and database to connect my project with and save all the required information by ASP.net membership.But there is where I get the issues: I have to:
Copy all the required columns from my local database to my external database e.g. username: VARCHAR(20) etc.
Connect to the external SQL database by changing the connection string in the web.config file
Some detailed information:
COPY ALL THE REQUIRED COLUMNS
I searched how to do this and figured out Microsoft SQL Server Management Software is the best software to edit and view my database, tables and columns on my local machine, for my external database I'm using PHPMyAdmin.
The problem is I don't know how to log in to my local machine database to view all my tables and columns. Some people say the server name is just the name of your machine:
But that does not work.
Also, filling in just a period ('.') does not work:
And even when I got it working? What do I have to do to see the columns and their data from my local visual studio C# website?
CHANGING THE CONNECTIONSTRING
I don't understand the connection string and how to connect it to my SQL database hosted on freesqldatabases.com. How does it work? (I read all the Microsoft docs but could not figure out)
If anyone knows how to get this working it would be really nice and helpful!
I'm working on a Windows Forms application in VS 2013 that requires saving data. I can't find a good solution for this, since:
A SQL Server database will work fine, but it will force the user
to have SQL Server installed on their computer.
The same applies to Access or Oracle DB.
DataSets require a database connection,which leads me to 1) and 3).
Text/XML files don't satisfy the
security requirements and will seem like a very primitive solution.
So , in essence, when the user installs the application, on its
first deployment it must create a database and keep it for future
access, without requiring the user to have any special programs
installed (e.g. SQL Server). I apologize if this question seems
stupid.
This is in two parts - how to create a database application and how to access it for initialisation.
Option 1 - if you can resolve the problem of installing SQL Lite/compact using the suggestions above then you can use Entity Framework with code first to create the database and tables. There are plenty of examples only a Google search away.
Option 2 - create an Access database (an MDB or ACCDB file) with blank/empty tables and deploy this as part of your application. You can the access this with a suitable connection string - again, Google will solve that one.
Use SQL Compact Edition .
Using LINQ to SQL you can create a Database/Tables for the first time deployment.
Please Refer the Link http://msdn.microsoft.com/en-us/library/bb399420(v=vs.110).aspx
I am new here to this forum so mind if I am asking a question already answered somewhere.
I have made an application in windows form, now I want to implement it onto another client PC. I published it and I can install it somewhere else fine, but the problem is that when there is a database involved I just cannot get it to work. I have tried everything I know, I attached the DB with the setup using the setup wizard creator but I cannot get it to work.
My main question is: How can I publish an application successfully, along with its DB and everything in working condition, without installing MS SQL on the client PC, if possible?
Typically, when using SQL Server, you are running in a client-server scenario, and SQL Server is the server portion. The connection string stored in app.config would point to the SQL Server, and the user would never need to know anything more about the database.
If your application is designed to be run outside of the network (i.e. 3rd party), you have a couple of options. First, if you want to use a full version of SQL Server, you can make a client installer and server installer. The server installer would be for setting up the server side (including the installation of SQL Server), and during the client setup, they would need to enter the name of the database server.
If the client has SQL Server Express installed, you can supply the database file, and do a direct connection to it rather than installing it inside SQL. However, if the client does not already have Express installed, this won't work.
Finally, SQL Server Compact Edition is designed for running on the client. You can do a "bin deploy" - that is, copy the SQL CE .dll files with your application, rather than installing the software, and the client can use the supplied database. If you haven't written the application for CE, this would require some rework.
you can also use sqlLite , it just need a bit of modification as it stated by Dave Simione
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
I've built a Compact Framework application to be used by delivery drivers. The system includes a WCF Service and SQL database on the server as well as a SQL CE database and CF application running on the mobile device.
Now the question is how to I update all this easily when I release new versions? The problems are:
it may be deployed to hundreds of PDAs
when first installed on a PDA the SQL CE database has to be populated. This can take a while. I don't want to have to do this each time the app is upgraded so I'm going to have to run scripts to update the db schema rather than just replacing the whole file and repopulating it.
the WCF service code will need to be updated
the SQL database schema will need to be updated
I can see solutions to all this but it seems like a lot of work. I thought it may be helpful to get a few tips before I launch into it all.
Thanks a lot
Mark
I think , you should divide your whole deployment in two phases
1- Client Deployment where you can upgrade your client ( PDAs + SQL CE )
2- Serevr Deployment where you can upgrade your Server side functionality ( WCF Service code + SQL Server database)
so these two phase must be independent of each other i.e. you can deploy both the phase simulteneously.
I ended up using WmAutoUpdate. Please refer to Automatically updating Compact Framework application code