Re: help. can't connect to sql server express with OleDbConnection




I suggest to place a break and check that both strSqlServerName and
strSqlServerDbName are string equal to an existing mdb and catalog,
respectively. (For the mdb could use a file.exists. For the catalog can
check the oledbschemaGuid.)

-tom

aboutjav.com@xxxxxxxxx ha scritto:

Hi,

I have this code

try
{

m_DbConn = new OleDbConnection("Provider=SQLOLEDB.1;Data
Source="+strSqlServerName+"; Integrated Security=SSPI; Initial
Catalog="+strSqlServerDbName);
m_DbConn.Open();
m_bDbConnInUse = true;
}
catch (Exception e)
{
throw new Exception(e.Message.ToString());
}


to try to connection to sql server 2005 with OleDbConnection. It keep
saying that I can't connecto to the database.

Any help is greatly appreciated,

thanks,

aj

.



Relevant Pages

  • Re: help. cant connect to sql server express with OleDbConnection
    ... strSqlServerDbName are string equal to an existing mdb and catalog, ... (For the mdb could use a file.exists. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.data.oledb)
  • Re: User Sync Errors
    ... How can i resolve them. ... Microsoft Small Business Specialist Partner ...
    (microsoft.public.windows.server.sbs)