plato
یک شنبه 13 اردیبهشت 1388, 08:34 صبح
من تو برنامه یه اتصال به بانک اطلاعاتی دارم که با این خطا مواجه شدم.
نکته: دیتابیس من Access هستش ولی این خطا به SQL Server مربوط میشه.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
اینم کدی که نوشتم :
OleDbConnection conn = new OleDbConnection("provider = Microsoft.ACE.OLEDB.12.0; Data Source =|DataDirectory|/Users.mdb");
OleDbDataAdapter dtAdapt = new OleDbDataAdapter("select * from tblUsers where sID = '"+Login1.UserName+"' and sPass = '"+Login1.Password+"'", conn);
DataTable dtTbl = new DataTable();
نکته: دیتابیس من Access هستش ولی این خطا به SQL Server مربوط میشه.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
اینم کدی که نوشتم :
OleDbConnection conn = new OleDbConnection("provider = Microsoft.ACE.OLEDB.12.0; Data Source =|DataDirectory|/Users.mdb");
OleDbDataAdapter dtAdapt = new OleDbDataAdapter("select * from tblUsers where sID = '"+Login1.UserName+"' and sPass = '"+Login1.Password+"'", conn);
DataTable dtTbl = new DataTable();