Pregunta

I am developing a website using WebMatrix in Asp.net. I have downloaded and installed SQL Server . Now I don't know how to create a database in SQL Server and how to connect to it using Razor Syntax/Method.

¿Fue útil?

Solución

WebMatrix is easy to connect to SQL Server; there is an old tutorial that can lead you: Connecting to a SQL Server or MySQL Database in WebMatrix.

With regard to create a table in SQL Server, there are books on how to accomplish this task. The easy way is to use SQL Server Management Studio. Googling I have found this tutorial that maybe could help: Creating databases using SQL Server Management Studio Express.

Otros consejos

If you want to work in razer and want to connect with data base and retrieve data.

var db = Database.Open("Employee");
var dbCommand = "SELECT * FROM Movies WHERE ID = '1'"; // Select the name where id=1
var row = db.QuerySingle(dbCommand);
if(row != null) 
{
     var employee_name = row.Name;
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top