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!
Related
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.
I developed a Winforms application with SQL Server 2008 R2 database for one my friends.
When I deployed & installed it on my friend's PC; software clearly shows database file. If he open that file in SQL Server, then he can able to watch my SQL queries, tbl structures etc.
I just want to hide all this from my clients.
How can I do this?
I search some of software on Internet. When I installed it on my PC; it not showing me any database file. How they do it?
Please help me.
If your application and database are both deployed on your friend's PC, there's almost nothing you can do to truly block him/her from getting to your database.
There is no feature in SQL Server that blocks schema view from an authorized user (e.g. admin) and if you own the machine, you can present yourself as admin to SQL Server in multiple ways even if you were not originally added to the admin role or given SA account access. You can setup hurdles like putting everything in stored procedures then encrypting the SP but it's just a small hurdle, not a wall.
This is not unique to SQL Server, the same issues apply to pretty much any RDBMS in the market. If you own the box, it's not hard to get to the DB contents. Software vendors have been trying do this for decades and most just give up and protect their IP legally instead. That's no consolation for you but it is reality.
If using a service like Azure is viable, you can host your app in Azure and the database can be Azure SQL DB or a regular SQL Server in a VM. I'd recommend the former if the feature set and surface area work for you; it's not identical to the SQL Server box product you're accustomed to. However, it is far less work for you to manage and secure. With the app also in Azure, your friend and clients will access via a browser and never have direct access to the database. Even if the app is installed locally on your friend's or clients' machines, it's easy to design the app such that they can only access data and nothing else.
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
here is the problem I am facing now. I have created an application that uses local database (this was created by Add -> New Item -> Local Database. Afterwards I have added tables under this .sdf database.
Then I have connected to this database using Add -> New Item -> ADO.NET Entity Data Model.
Everything works like a charm, unless I was asked to move this database to a place, where multiple people could access this database and work with it.
Therefore, as I have no previous experience with databases, I have treated this .sdf file as any other file (let's say Excel workbook) and I thought that I could simply take already existing database, copy it on server computer (e.g. \Server001\Database\Database1.sdf) and simply change connection string under app.config.
However the problem is that this does not work. As I didn't know how to change connection string, I created new application, where I have tried to connect to this database located on a server computer; however I received the following error:
SQL Server Compact does not support opening database files on a network share.
I already have fully functioning program, but I have no idea how to make it work with multiple users. I have tied to google for solution, but all I could find is how to create local database, not how to make it accessible by placing it in server computer.
Could you guys please help me? If you need more details, please let me know!
P.S. This is WPF application, .NET 4.5, created using Visual Studio 2012 Professional.
Thank you!
The error message pretty much sums up the problem: SQL Server Compact does not support opening database files on a network share.
SQL Server Compact (aka "local database") is to be consumed by a local application; even if it was a web app serving many requests, the application itself is local.
If you want to have multiple remote connections (i.e. centralized DB, distributed app), you should look at using an instance of SQL Server (any SKU would probably work, even SQL Server Express). Those will use MDF files instead of SDF files, so you might want to refer to Convert .sdf database to .mdf database. You'll probably also need to set up a user identity for your connection string, so check out this link on CREATE USER and Difference between a User and a Login in SQL Server to understand how that can be configured.
I'm a newbie.. So, please forgive me if it's a simple question :)
I'm developing a system to get some specific data and store it to a database using C#. I have almost finished the system.
I'm using a MySql database running locally on my machine. I need this database to be accessed remotely so that my employer can view the data. He told me to create a phpMyAdmin interface for the database, but I don't have experience with this.
I need the solution to be free, please.
Thanks in advance.
phpMyAdmin is free. You just have to download and install it on the machine with MySql. You will also need a WAMP stack (PHP web server hosting, such as the free WampServer package) to execute the phpMyAdmin website, and open the ports in your router to allow viewing the webpage remotely. Also there might be configuration settings in phpMyAdmin to allow remote access, but all these things have been done many times before and you should be able to find lots of help by googling.