ADO.NET连接字符串 [英] ADO.NET Connection String

查看:85
本文介绍了ADO.NET连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQL Server 2008数据库,该数据库使用名为 Arxame的默认架构。如何在连接字符串中将默认架构从 dbo指定或更改为 Arxame?我正在使用C#和ADO.NET。

I have a SQL Server 2008 database that uses a default schema called "Arxame". How do I specify or change the default schema from "dbo" to "Arxame" in my connection string? I'm using C# and ADO.NET.

推荐答案

您不能这样做。您必须将架构 Arxame设置为在连接字符串上指定的用户。您可以使用SQL Server管理工具来完成此操作

You can't do that. You have to set the schema "Arxame" to the user you have specified on your connection string. You can do this using the SQL Server Management tool

如果需要更改现有用户的默认架构,则可以这样做

If you need to change the default schema for an existing user you can do it like this



B。更改用户的默认架构

B. Changing the default schema of a user

下面的示例将用户Mary51的默认架构更改为购买。

The following example changes the default schema of the user Mary51 to Purchasing.

USE AdventureWorks2008R2;

使用ALFA USER Mary51和DEFAULT_SCHEMA =购买;

GO

USE AdventureWorks2008R2;
ALTER USER Mary51 WITH DEFAULT_SCHEMA = Purchasing;
GO


来源: MSDN

这篇关于ADO.NET连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆