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:
Please let me know what am I doing wrong here.
Regards,
Salman

Amit GuptaRank #190 · 12.8K reputationPosted Feb 24, 2018, 7:59 AM EST
Instead of
WINSTAR-PC\SQLEXPRESS
Nitin SontakkeRank #264 · 9.6K reputationPosted Feb 24, 2018, 5:58 PM EST
Salman N22 reputationPosted Feb 24, 2018, 7:21 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Feb 24, 2018, 8:15 PM EST
Salman N22 reputationPosted Feb 24, 2018, 8:36 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Feb 24, 2018, 9:04 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Feb 24, 2018, 9:09 PM EST
Salman N22 reputationPosted Feb 24, 2018, 9:16 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Feb 24, 2018, 11:31 PM EST
Khaja MoizuddinRank #270 · 9.4K reputationPosted Feb 25, 2018, 1:21 AM EST
Dharmraj ThakurRank #577 · 4.2K reputationPosted Feb 24, 2018, 6:00 PM EST
Dharmraj ThakurRank #577 · 4.2K reputationPosted Feb 24, 2018, 7:37 PM EST
Dharmraj ThakurRank #577 · 4.2K reputationPosted Feb 24, 2018, 8:57 PM EST
Dharmraj ThakurRank #577 · 4.2K reputationPosted Feb 24, 2018, 11:25 PM EST