无效的对象名称DBTOOLUSERS

时间:2017-01-17 15:45:26

标签: c# sql sql-server visual-studio-2015 sql-server-2014

好的,我知道有很多关于这个问题的问题,但我似乎无法在那里找到解决方案。此外,他们中的很多人都使用硬编码查询,但我使用xsd文件连接到SQL Server 2014.以下是例外:

Error that has been thrown by sqlconnector

这是我的连接字符串:

let realm = try! Realm() realm.beginWrite() let locations = User.locations //existing locations var locIdsAdded : [String] = [] //1. collect existing locations let existingIds = channels.map({ (loc) -> String in return loc.primaryKey }) //2. add or update objects from server for loc in locationDictsFromServer { let locObj = parseFromDict(loc) //parse dictionary into RealmObject realm.add(locObj, update: true) // update: true not to add duplicated if(existingIds.index(of: locObj.primaryKey) == nil) { // check if need to add user.locations.append(locObj) } locIdsAdded.append(locObj.primaryKey) } //3. remove non updated objects var removeSet:Set<String> = Set(existingIds) removeSet.subtract(locIdsAdded) for(removeId) in removeSet { if let obj2Remove = realm.object(ofType: UserLocation.self, forPrimaryKey: removeId) { realm.delete(obj2Remove) } } try! realm.commitWrite()

我检查了表存在,以便用户。我可以连接到数据库,查看列表中的表,从xsd运行查询。但每当我尝试通过C#运行它时,它会引发上述异常。

我的C#代码是这样的:

Data Source=NLNT832\SQLEXPRESS,2301;Initial Catalog=IPC_DATABASE;Persist Security Info=True;User ID=ipc_sp_user;Password=omr@n123

以下是数据库中存在的表格的屏幕截图,可通过提供的用户名访问。Table present in the database

仅供参考我敦促您在将其标记为副本之前三思而后行。

0 个答案:

没有答案