简体   繁体   中英

Error: Invalid object “tbl_name”

I am creating a small project by using winforms in C# using Visual Studio 2010 and SQL Server 2008 - When I am creating setup and running it on the same computer it is working very well - but when I am running it on a different computer I got an error (Invalid object "tbl_name")! I'm using (SQL Server authentication) and my connection code is:

SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = ".";
builder.InitialCatalog = "Sectors";
builder.IntegratedSecurity = false;
builder.Password = "123";
builder.UserID = "MAK";
builder.AsynchronousProcessing = true;
builder["Trusted_Connection"] = true;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = builder.ConnectionString;
conn.Open();

Please help me find the cause of the error and resolve it.

You could remove the statement "builder["Trusted_Connection"] = true;" and also try to change the connection settings (like DataSource to localhost).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM