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
Khaja MoizuddinPosted Feb 25, 2018, 6:21 AM
Nitin SontakkePosted Feb 25, 2018, 4:31 AM
Dharmraj ThakurPosted Feb 25, 2018, 4:25 AM
Salman NPosted Feb 25, 2018, 2:16 AM
Amit GuptaPosted Feb 25, 2018, 2:09 AM
Nitin SontakkePosted Feb 25, 2018, 2:04 AM
Dharmraj ThakurPosted Feb 25, 2018, 1:57 AM
Salman NPosted Feb 25, 2018, 1:36 AM
Nitin SontakkePosted Feb 25, 2018, 1:15 AM
Dharmraj ThakurPosted Feb 25, 2018, 12:37 AM
Salman NPosted Feb 25, 2018, 12:21 AM
Dharmraj ThakurPosted Feb 24, 2018, 11:00 PM
Nitin SontakkePosted Feb 24, 2018, 10:58 PM
Amit GuptaPosted Feb 24, 2018, 12:59 PM
Instead of
WINSTAR-PC\SQLEXPRESS