Home > Database > Mysql Tutorial > body text

命名空间"Microsoft.SqlServer"中不存在类型

WBOY
Release: 2016-06-07 15:40:14
Original
1042 people have browsed it

using System; using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; namespace DAL { public class SMODemo { public static void Main() { ServerConnection conn = new ServerConnection(); conn.LoginSecure = fals

using System;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;


namespace DAL
{
    public class SMODemo
    {
        public static void Main()
        {
            ServerConnection conn = new ServerConnection();
            conn.LoginSecure = false;
            conn.Login = "userName";
            conn.Password = "password";
            Server svr = new Server(conn);
            Console.WriteLine(svr.Name + " " + svr.Information.VersionString);
        }
    }
}
编译时有下面的错误:怎么解决呢?

SMODemo.cs(4,27): error CS0234:
        命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Management”(
        是缺少程序集引用吗?)
SMODemo.cs(5,27): error CS0234:
        命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Management”(
        是缺少程序集引用吗?)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!