Salman N

Salman N

  • NA
  • 10
  • 1.2k

How to run exe in another system which is in same LAN

Feb 24 2018 10:30 AM
Hi All,
 
I have developed a C# project and have created an exe.
 
Now the problem is I can install and run the exe in the my system(i.e this is the main system) .However when I install the same exe in another system available in my LAN network and run getting error as (EXE has stopped working) . I don't why.. Those systems have already installed with the respective Dot Net 3.5 versions.
 
I dont know what is stopping the exe to run .
 
My Data Connection class is as follows:
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient ;
using System.Data ;
using System.IO;
using System.Xml;
namespace FiberGeneric
{
public class DataConnection
{
public SqlConnection funGetConnection()
{
string yourpath = Environment.CurrentDirectory + @"\FiberConfiguration.xml";
XmlReader reader = XmlReader.Create(yourpath);
reader.Read();
reader.ReadStartElement("connection");
reader.ReadStartElement("server");
//xmlDocument.GetElementsByTagName("server").Item;
string sServername = reader.ReadString();
reader.ReadEndElement();
reader.ReadStartElement("database");
string sDataBasename = reader.ReadString();
reader.ReadEndElement();
reader.ReadEndElement();
SqlConnection Con = new SqlConnection(@"Data Source=" + sServername + ";Database=" + sDataBasename + ";Integrated Security=True;Connect Timeout=300;");
return Con;
}
}
}
 
My XML Configuration file code is as follows:
 
<?xml version="1.0" encoding="utf-8" ?>
<connection>
<server>WINSTAR-PC\SQLEXPRESS</server>
<database>HR</database>
</connection>
 
Please let me know what am I doing wrong here.
 
Regards,
Salman

Answers (14)