Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every one

I'm working on Northwind database, I could get access to the tables by code using ADO.net, but when I try to load the tables in server explorer, after adding the database, I can't see the tables and I get the Error:

Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral ...

what is the problem?

Tnx

by code it is working:


C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlServerCe;
using System.Data.SqlClient;
using System.Data.Sql;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            SqlCeConnection Connection = new SqlCeConnection("Data Source=E:\\Northwind.sdf;"); 

            try
            {

                Connection.Open();

                SqlCeCommand Command = Connection.CreateCommand();

                Command.CommandText = "SELECT * FROM Employees";

                SqlCeDataReader Reader = Command.ExecuteReader();

                while (Reader.Read())
                {
                    Console.WriteLine("\n RegionId={0}\t RegionDescription={1}",Reader.GetSqlInt32(0).Value,Reader.GetSqlString(1).Value);
                }

            }
            catch (SqlCeException ex)
            {

                Console.WriteLine(ex.Message); ;
            }

            finally
            {
                if (Connection.State == System.Data.ConnectionState.Open)
                {
                    Connection.Close();
                }
            }


            Console.ReadKey();


        }
    }
}
Posted
Updated 12-Jul-13 22:53pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900