帮帮忙,我数据库在本机是用sa用户创建的呢,然后在本机测试是没有问题的,链接的代码是这样的、
      <connectionStrings>
<add name="StrConn" connectionString="Data Source=.;Initial Catalog=china12345;Persist Security Info=True;User ID=sa;Password=sa;Max Pool Size=1000" providerName="System.Data.SqlClient"/>
</connectionStrings>
然后我把数据库放在服务器上的时候,就会报对象名 无效的问题,我不知道是什么原因的呢,请各位帮帮忙吧
<connectionStrings>
<add name="StrConn" connectionString="Data Source=116.255.145.108;Initial Catalog=china12345;Persist Security Info=True;User ID=china12345;Password=xunway123;Max Pool Size=1000" providerName="System.Data.SqlClient"/>
</connectionStrings>

解决方案 »

  1.   

    服务器上你的user id是china12345?
      

  2.   

    ping 一下服务器的IP,能否ping通?
      

  3.   

      看到LZ的是没有问题的,你看下网络是不是正常。 在服务器上sa的密码是不是对的。。
      

  4.   

    User ID=china12345;Password=xunway123你确定这个login对应的user有足够的权限去访问这些objects!还有sa不是一个user,它是一个login,这个login要对应相应的数据库user才有权限访问schema下的objects!例如sa的关系:
    login:sa
    serverrole:sysadmin
    map user:dbo
    databaserole:db_owner
    default schema:dbo访问数据库主要看databaserole:db_owner这个。
      

  5.   

    和sa没关系,主要是看china12345这个login有没有对应到被访问的数据库的user和priviledges。
      

  6.   

    你把china12345这个登录的用户放成和sa一样的权限。
      

  7.   

    可是服务器是xunway那边提供的呢。他那边一直说我数据库有问题的呢
      

  8.   

    网上说 改成有dbo的就没问题,可是还是老羊的呢 
    exec sp_msforeachtable "sp_changeobjectowner '?','dbo'
      

  9.   

    应该报无法连接!它(OS或者SQL Server)报错了,我替它道个歉!