Connecting to a database in Visual Studio - mysql

I'm afraid I have been stuck on this one for a couple days now.
I've worked with databases before (normally using php and a mysql server) but I'm new to visual studio and I just can't seem to find much info on what kind of server you need to connect to (and how).
I guess the first part of my question would be: Can the server running the database be a remotely hosted "online" mysql server or does it have to be installed on your machine (for example like you can install apache)?
The easiest option for me would probably be to connect to my existing mysql server of my online website, but how?
I have sql server management studio installed but am not sure what to enter as the server name etc in the dialog box that shows up.
I do know my mysql server details and all, but just have no idea how where and how or even if I can connect it directly to my visual studio project.
I have looked several times on google but till now I have only been able to find videos and tutorials showing how to create a new database - which assume you are already connected to some sort of server.
Also, if you do use a locally hosted database server then wouldn't you have to port it to a different (online) database once the website goes live?
Thank you for your time!

Yes, the database can be remotely hosted, I'have this working on my local machine with a remote MsSql database. Make sure the remote database server accepts connections from your IP.
I'm pretty sure the MsSql Server Management Studio is only for MsSql, not MySql. The server name in my case is the IP for the remote MsSql database server, further you need the login and password for your database. But if you use your remote MySql, you don't need this tool.
I have no experience with MySql, but it must be possible to use the database in your Visual Studio project with the correct "connectionstring". The connectionstring contains the type of the database, where it is located, login and pasword, etc. You can find the syntax of you connectionstring here: www.connectionstrings.com/mysql/

Related

Windows App with mySQL Backend

I am trying to design a database application for my small business. I've created a number of form driven MS Access databases for use before but would like to create a permanent solution in something more advanced & common.
I was thinking of using mySQL for the database and would then program a C# or VB application to be used in Windows. I do not want or need a web based version at this time but the migration to VB.net in the far future may be something I'll look into.
I know I can use a MS Access backend for my windows application without having to install MS Office on any or all the computers the program will be run for.
But here is my question. Is it necessary to install mySQL Server on the PC hosting the database, on all the PCs accessing the database or can I just use the database file as the backend and Visual Studio will have all the necessary tools I need to access it?
If I have to install the server I may just stick with the MS Access database as the needs for an excessive amount of database storage won't ever be an issue.
You'd need to install MySQL server on the Server hosting the database. The clients would then connect via the network. You will however need a driver to access the MySQL-Server with VB.NET on the client machines. A simple DLL-File might be enough, though.
If you are looking for a file-based database solution have a look at SQLite. But you will have to watch out for concurrency issues here.

Windows client - MYSQL server on linux

I have a Winforms desktop app that need to read/write data from/to a MYSQL database. The MYSQL server is on a machine that runs on Linux OS. I need to know if a .NET connector is to be used or an ODBC connector?
Also, considering that I do not need remote access to MYSQL server, is a connector sufficient to access the server from the windows desktop? Do I need to do something on the server side? I've been looking around and getting mixed signals, some people said a web service is required while others said no.
I need to know if a .NET connector is to be used or an ODBC connector?
I never connected to MYSQL before, but i think you can use these data provider or, ODBC too.
Is a connector sufficient to access the server from the windows desktop?
Yes. A valid address to your server is all you need to access it, using data providers or ODBC. Of course, your database need to be up and running too.
Do I need to do something on the server side?
Just install your MYSQL database.
Maybe this link will help you.

Connect to sql server 2008 using Microsoft Server Management Studio

I have difficulties connecting to my MS SQL Server and I can't find tutorial or answer how to do this, even though I think this should be something pretty standard.
My current setup is this - I have freshly new Installed Visual Studio 2010 and followed Beth Massi's article Step-by-Step: Installing SQL Server Management Studio 2008 Express after Visual Studio 2010 : http://blogs.msdn.com/b/bethmassi/archive/2011/02/18/step-by-step-installing-sql-server-management-studio-2008-express-after-visual-studio-2010.aspx
But I'm not able to connect to a SQL Server. In my Configuration Tools\SQL Server Configuration Manager I see this when I open it :
I set to Enable all TCP\IP and Named Pipes (Just saw that this may be a problem) and in the properties of the SQL Server (SQLEXPRESS) from Services I see this:
I also see in the Log On tab this :
some sort of password (not entered by me) it seems to be something default, but since I'm not sure where the problem is I try to show everything I think may have something to do with solving my problem.
At the end I tried different options to connect to my SQL Server form the Management Studio I ended up with this:
As you see I get an error (included in order to be able to read it). I read the the machine name may be required so my User Account name is Xman and my machine's name is Xman-PC. Eveh though my printscreen image is not from this try I made an attempt to connect to the Server with XMAN-PC\SQLEXPRESS but again - no success.\
Could you point me to a good tutorial on how to connect to a MS SQL Server (I can't believe there's nothing that explains in simple steps what you need to do to connect to a server) or could you tell me how to set-up my configurations so I actually can start to work with databases?
P.S
Forgot to mention in Command Prompyt - sqlcmd command also returns error - Could not open SQL connection.
P.S
Finally I managed to connect using Windows Authentication and (local)\sqlexpress for ServerName. Which at least means that everything is working. But now even more I would like to know how to connect using SQL Server Authentication. It must be something default as it was for Windows Authentication?!
Looks like you've done the hard work - last step will be turning on SQL Server Authentication.
Since you installed with the default values, only Windows Authentication is allowed; you need to set it to SQL Server and Windows Authentication mode. You can do this through Management Studio through the instance Properties -> Security.
See this link for full details: Change Server Authentication Mode.

VB.net Project using MySQL user locally

Need Help.
I made a vb.net project, it is already finished. but my problem is, after i install the project i made to another computer. it can't connect to the database unless the WAMP server is open. is there a way to user without opening WAMP server?
WAMP stands for Windows Apache MySQL PHP. It runs MySQL server, so you need it to access database. Option is that user on another computer runs some MySQL server or connects to web server that runs database required for application.
You could also consider using Microsoft Access database. In this case you don't need server. All database is just in one MS Access file.

Connect to MySQL from VBA without a driver

I installed xampp on my computer and I want another computer to access the mysql db in vba. But, they don't have admin right on their computer and cant get it, and they dont have mysql ado driver installed.
Is there a way to do it without this driver - can I use a portable driver or a windows standard lib?
At the moment all I can do is create a php page and use post data with a sql query, getting the result as xml or whatever, which is really not what I want.
Without the correct ODBC driver the app won't be connecting to the database directly. You'll have to do through some sort of middle tier that does have the driver installed.
Your solution here is to have the user call the help desk and have them install the MySQL drivers on his PC. If this is business critical it shouldn't be hard to get it approved. If not you'll need to redesign the app to fit within the IT policies.