Friday, 30 August 2013

Error52 unable to locate Database runtime installation

Error52 unable to locate Database runtime installation

I created this software that is database related when i install it on my
machine and access its database it runs perfectly but when i install it on
another machine and i try to access the database it gives this error :
A network-related instance or instance-specific error occurred while
establishing a connection to SQL server. The Server was not found or was
not accessible. Verify that the instance is correct and that the SQL
Server is configured to allow remote connections. (Provide: SQL Network
interfaces: error 52 - Unable to locate the database runtime installation.
Verify that SQL Server Express is properly installed and that that the
local database runtime feature is enabled
this is the code for the connection i did
var ttg =
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
SqlConnection con = new SqlConnection(@"Data
Source=(LocalDB)\v11.0;AttachDbFilename="+ttg+"\\Datex Inc\\Time Table
Generator\\Database\\timetable.mdf;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
con.Open();
DataTable dt = con.GetSchema("Tables");
foreach (DataRow row in dt.Rows)
{
string tablename = (string)row[2];
//MessageBox.Show(tablename);
if (tablename != "schools" && tablename != "records")
{
databasenames.Add(tablename);
box.Items.Add(tablename);
}
}
con.Close();
Its really frustrating and i used the visual studio install shield limited
edition project to build my installation file which includes the database
and primary outputs of my software. Is there anything i did wrong? and how
do i properly install my software with database on another machine with
out this error?

No comments:

Post a Comment