SignalR Hub with Windows Azure SQL Database - c#

I've been a developer for a long time but I've never laid my hands on sql databases (I know, not smart of me). Anyway, I need to a create a databse on windows azure sql, design the tables and columns, and then access it using (Entity Framework , Entity Client, etc) from my ASP.NET Web Application.
I've followed this tutorial to create the database http://www.windowsazure.com/en-us/develop/net/how-to-guides/sql-database/ , I successfully created everything, just don't know how to connect to it now. Also, when I click on Manage on windows azure, I can see that the sql database (not the server) is prompting me to create a database ... inside my database which confused me a lot.
I've had a look at these, still not sure if that's what I'm looking for
http://msdn.microsoft.com/en-us/library/windowsazure/ff951633.aspx
All I need is a simply tutorial that would explain how do I connect to my database in order to design it (columns and tables), and then how do I access, read, write data from an ASP.NET Web Application
I'm using Visual Studio 2013 (I have 2012 installed as well), and can download whichever tool that would allow me to connect that dabatase.
Please help

The designer is not supported in Azure SQL..
You can instead us this link : https://SERVERNAMEGOESHERE.database.windows.net/
that contains an online database editor, or you could use a localdatabase first and then deploy through management studio
if you need your connectionstring later you can get this through windows azure portal --> your database --> Quick glance --> SHOW Connectionstring

Related

Can't find my EF code first db

I know that there are some similar topic, but still I haven't found soultion.
I have create a simple ASP.NET MVC app with EF code first. I set no connectionstring, and everything works fine. I can perform CRUD actions and records are updated. But I don't know where my database is.
I am using Microsoft SQL Server Management Studio to connect to server. In Server name field I have tried to put: localhost, ., .\SQLEXPRESS, my Desktop name. These are all answears which I have found searching solutions.
Then in all cases I expand Databases/System Databases and all other Databases, but I can't find mine.
I know, that I can create an empty Database in Management Studio and set connectionstring to this DB (and it works), but I must send app to my teacher, and you know, he want to only click run, without setting up anything.
Have you got any solution?
Looked in yourproject/App_Data? Usually, the DB files are created there

Connect to MS Access Database with android

I'm working on a project and I need to connect to MS Access Database. The problem is that I'm using a pretty new platform , I'm using Visual Studio 2015 Xamarin and I'm developing to android with c# (thought this platform).
I already have a project with this Database using aspx and i need to connect the android application to this Database .
I could not find any answer for it , probably cause it's new .
Thanks for helping.
The problem is not related only to Xamarin or MS Access.
Everytime you want to use the same database in different applications (in your case a website and mobile apps), it is better to create a new layer (WCF Service or REST API) in order to access the same database on the server. This is more flexible and would be the right thing in your case.
Without moving the architecture to the next Level, you will always have such problems when mixing old and new technologies together.
If you just want to finish this quickly for school and use the database only on the device, then there is no way to use the MS Access database with xamarin. I recommend using SQL lite for this and there are lots of examples for that:
https://developer.xamarin.com/recipes/android/data/databases/sqlite/
It not clear if the database is to run “local” on the android, or you just wishing to connect to some web service that holds the database?
If you needing a local database to run 100% stand-alone on the Android device, then Access is not supported. Your best bet for a local database would thus be SQLite.
Perhaps you don’t need nor want a local data store. In this case if the Access database is on the server, then you would be forced to write some kind of web service to “interact” with your Android software and the web server (this would not be a "general" interface to the database, but a set of web services that you expose on the web site - this assumes you thus have control and are able to write software and implement a web service on the web site. So in this case some kind of “direct” connection to the Access database is not possible.
You could again certainly DIRECTLY connect to a server based database like SQL server – but this would assume the web hosting allows external ODBC connections to the database (often they don’t allow this, but some do).
So not clear is if you need a local database running on the Android that can THEN connect to some web or server based system, or you simply want the android to connect via the internet to some database hosted on some server and the Android device does not have a local database at all.
Regardless of the location of MSAccess, you cannot "connect" to a non server database like Access. So the question remains as to "where" you want this database to be used, and ALSO if you need a local data store on the Android device or not.

MVC 3 C# - Deployment and MYSQL Database

Visual Studio 2010 - C# - MVC3
I am completely new to ASP.Net and I have been working / practising making an MVC 3 application using C#. I have practised getting an MVC application online which makes use of no databases and was successful. My hosting supports .net 4 and it was a simple process of publishing the files and uploading to my FTP. I am making a new application which makes use of a database. I have set up a data connection in the server explorer and set up all my tables and relationships. Everything is currently working as intended and I can create, edit and delete entries from the database.
I am not really sure where to start with getting this online. My hosting offers no MSSQL databases so I am presuming I can use a MYSQL database? What is the process of changing my application to use a MYSQL database which is located on my remote hosting? Also I am making use of the default accounts where users can register and login, will I have to set up a database for this too?
Your host offers mysql hosting?
you will need the mysql .net connectors.
also check this next out for the asp.net membership, mvc uses
http://dev.mysql.com/doc/refman/5.1/en/connector-net-tutorials-asp-roles.html
You can use a local DB in your APP_DATA folder or you can connect to a remote DB. Please let me know if you need additional help in either of these two areas or if I have misunderstood your question. You may also want to encrypt your web.config file to secure your DB passwords better.
From our chat:
Try this stackoverflow.com/questions/…
SQL CE supports binary deployment, meaning your hosted doesn't have to have anything installed and you get SQL support, however no stored procedure support (if that matters to you here)
In addition you can install the SQL Compact Toolbox into Visual Studio
http://sqlcetoolbox.codeplex.com/
See: http://blogs.msdn.com/b/webdev/archive/2011/01/06/how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects.aspx

Can I access a remote Database through webservice? C# winforms

Lately I asked this question regarding connecting my window app to a remote database (MySQL) hosted by some free hosting site. And I got "No way" answers.
How about using a webservice? Is it possible now?
Ok (and probably assuming .NET 4.0 on you hosting provider) this should be fairly straightforward:
Yes you can access data via a webservice.
If you want to with a minimum of effort you can use WCF Data Services
Not tried this but...
Create a web application
"Build" an entity framework model for your data (see Using MySQL with Entity Framework for linking EF to MySQL)
Create the data service (which seems mostly to be a matter of doing an add new item in visual studio)
Enable access to data service resources - i.e. change some code to make sure you can see what you need.
At this point you should end up with CRUD access to your database via a fairly comprehensive web service...
Biggest challenge there will be building the EF model - you really want a local instance of the MySQL database - schema at least - to develop against.
Yes if your webservice is hosted on same server which contains mysql database. You can locally connect to mysql using webservice (which hosting providers allow for sure) and can server data using the service.

using MySQL with C#

I want to know if it is possible to use MySQL Engine without having to install WAMP Server. I'm developing an application that will require a database, so I was thinking of using MySQL instead of MS SQL or access. So I don't want to install the WAMP package yet I want to install the MySQL Engine, so if possible, please provide me with the download link for the MySQL and how to install and use (start/stop service).
You will need the runtime and the .net connector to make this happen. You also might find the workbench (gui tools to manage the server and run queries) to be helpful.
The runtime installs a service by default, which you can control on the commandline or via the windows service management console (services.msc).
This sounds to me a lot like you're thinking 'desktop application', where the MySQL database will be a simple local data store. If that's the case, MySQL is not a good choice.
MySQL is a server-class database engine. It's designed to run full time in the background as a service. This makes it overkill for a simple desktop app, and as a user I'd be mad if your simple desktop app required me to run the MySQL service.
For the kind of app I think you're building, you really want an in-process or desktop-class database. Good examples include SQLite, SQL Server Compact Edition (not Express), or even MS Access. Any of those would be a better option here than MySQL.
On the other hand, if I'm wrong and you're building a web app or an app that will be distributed to several computers that all share the same database, then MySQL is a perfectly fine choice and you should read #Femaref's answer.
If your database isn't going to be incredibly large you could go with SQL Compact. It comes with the .NET framework, and works well for smaller databases.

Categories