this is my connection class, i know i am going to put the ip, or i am in a error ? the direction of internet? what do i go to put? can i do it with web service? what is the form easy for to do it? here my connection class…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace MisNotas.Conexiones
{
class Conexion
{
public SqlConnection conectar()
{
SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial Catalog=misnotas;Integrated Security=True");
return con;
}
public void EjecutarConsulta(SqlCommand comando)
{
comando.Connection.Open(); // open connection
comando.ExecuteNonQuery(); // execute the query
comando.Connection.Close(); // close the connection
}
}
}
The idea is since another place, i can to start session and to do queries and edits… how to do it?
it is in windows application not in asp.net.. thanks
i will put diferents tags for the import is how to do it… thanks
I think the question is how to access a database on a different machine, if that is the case – you can specifiy the IP address or name of the remote machine in the connection string:
Note however you still have to figure out security, i.e. integrated security might not work remotely – for a full list of the options with examples check out this link.