Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4547958
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:09:44+00:00 2026-05-21T16:09:44+00:00

this is my connection class, i know i am going to put the ip,

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:09:45+00:00Added an answer on May 21, 2026 at 4:09 pm

    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:

    public SqlConnection Conectar(string remoteMachine)
    {
          SqlConnection con = new SqlConnection(string.Format(@"Data Source={0}\sqlexpress;Initial Catalog=misnotas;Integrated Security=True", remoteMachine));
          return con;
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I do this manually public class AdventureWorks : DataContext { public AdventureWorks(string connection)
In a 32-bit .NET app, I can use this OLEDB connection string to connect
You can change the connection string at run-time like this. You make the connection
Does anybody know what's going on here: I run hibernate 3.2.6 against a PostgreSQL
I open a connection like this: Using conn as New OdbcConnection(connectionString) conn.Open() //do stuff
Per this helpful article I have confirmed I have a connection pool leak in
In this sentence: myCommand.ExecuteReader(CommandBehavior.CloseConnection) does it close connection in case of exception?
I found this: http://www.evolt.org/failover-database-connection-with-php-mysql and similar examples. But is there a better way? I
So I have this website that will be accessed via an SSL connection (
I had someting like this in my code (.Net 2.0, MS SQL) SqlConnection connection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.