9 Replies - 393 Views - Last Post: 02 December 2013 - 10:53 AM Rate Topic: -----

#1 vinay.kalled@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 15-November 13

Accessing Database from other System

Posted 02 December 2013 - 03:12 AM

I have developed Windows Form Application using SQL20008 DB. Now i want this application to run on other Machine. I know 2ways but unable to do it i.e
1. Installing SQL server on other system
2. Accessing Server system from other system

Query1: How to access my system from other system?? I have created exe file n want to run it on other system
what to put in Connection String while creating exe file??
Connection string is: "Data Source=local; Initial Catalogue= Inventory; Integrated Security=True";

Query 2: How to take .MDF file from SQL server2008??

Is This A Good Question/Topic? 0
  • +

Replies To: Accessing Database from other System

#2 jhouns  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 25
  • View blog
  • Posts: 100
  • Joined: 21-December 09

Re: Accessing Database from other System

Posted 02 December 2013 - 03:41 AM

1) Use network programming, starting with changing that "Data Source=local" field.

2) Honestly never done it, will look.

But it sounds like you can find all your answers on this handy stack overflow which was the top result in google when looking for: "c# with remote databases".
Was This Post Helpful? 0
  • +
  • -

#3 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 736
  • View blog
  • Posts: 3,221
  • Joined: 03-December 12

Re: Accessing Database from other System

Posted 02 December 2013 - 07:15 AM

If you want two different databases you can include the database with the build. If everyone is going off of the same database, install the server on ONE computer and the connection string show be what computer hosts to server you are connecting to. But, you will need to know the IP of the host computer on the network.
Was This Post Helpful? 1
  • +
  • -

#4 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4539
  • View blog
  • Posts: 7,917
  • Joined: 08-June 10

Re: Accessing Database from other System

Posted 02 December 2013 - 10:22 AM

IMO, you're going about this all wrong. SQL Server is exactly what it sounds like: a "server". It should be installed on a central server somewhere and all clients should connect to it from there. You would put the SQL Server's address in the Data Source field, possibly with an instance name if you're using named instances. This is all part of the setup of the SQL server.

If you want to publish changes from one DB to the other, you could take the DB offline, copy the mdb, and import it into another instance, but I think it's a better idea to make a DB project and use that (along with the Schema Compare tool in VS) to keep your DB schemas in sync.

If, on the other hand, this is an application that needs to have its own database (for example, if we were both running the app on two separate computers, should they be seeing/saving the same data, or should they each be working with just their own?), you should use a compact portable database, like Sql Server CE or Sqlite.
Was This Post Helpful? 0
  • +
  • -

#5 vinay.kalled@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 15-November 13

Re: Accessing Database from other System

Posted 02 December 2013 - 10:30 AM

View Postastonecipher, on 02 December 2013 - 07:15 AM, said:

If you want two different databases you can include the database with the build. If everyone is going off of the same database, install the server on ONE computer and the connection string show be what computer hosts to server you are connecting to. But, you will need to know the IP of the host computer on the network.


Am writing local system's IP address in connection string but when i run my application its showing log in form n as i enter id & password its hanging. So how should i overcome this?
Was This Post Helpful? 0
  • +
  • -

#6 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 736
  • View blog
  • Posts: 3,221
  • Joined: 03-December 12

Re: Accessing Database from other System

Posted 02 December 2013 - 10:35 AM

It is hanging on connection to the server computer or it is hanging logging in to the database?
Was This Post Helpful? 0
  • +
  • -

#7 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 736
  • View blog
  • Posts: 3,221
  • Joined: 03-December 12

Re: Accessing Database from other System

Posted 02 December 2013 - 10:41 AM

Connection string for IP connection
Was This Post Helpful? 0
  • +
  • -

#8 vinay.kalled@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 15-November 13

Re: Accessing Database from other System

Posted 02 December 2013 - 10:48 AM

View Postastonecipher, on 02 December 2013 - 10:35 AM, said:

It is hanging on connection to the server computer or it is hanging logging in to the database?


Logging into DB.
Actually on my system, Visual Studio 2010 & SQL server 2008 is installed. I have created windows form application & i want to create exe file of tat & run in other system. So before creating exe file, in my connection string i have changed from:
"Data Source=local; Initial Catalogue= Inventory; Integrated Security=True";
to : "Data Source="System's IP Address" ; Initial Catalogue= Inventory; Integrated Security=True";
when i run my application in my system, its not logging.

View Postastonecipher, on 02 December 2013 - 10:41 AM, said:

Connection string for IP connection


I tried with both IP address along with port no, but its still hanging
Was This Post Helpful? 0
  • +
  • -

#9 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3642
  • View blog
  • Posts: 12,635
  • Joined: 12-December 12

Re: Accessing Database from other System

Posted 02 December 2013 - 10:49 AM

It is Initial Catalog
Was This Post Helpful? 0
  • +
  • -

#10 vinay.kalled@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 15-November 13

Re: Accessing Database from other System

Posted 02 December 2013 - 10:53 AM

View Postandrewsw, on 02 December 2013 - 10:49 AM, said:

It is Initial Catalog



Ya i have written correct in my code, sorry while typing here i have typed it wrongly.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1