Posts Tagged ‘Namespace’

Namespace or type specified in the project-level Imports ‘System.Xml.Linq’ doesn’t contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn’t use any aliases

There are 2 ways to remove this warning

First, you may need to convert the current .Net Framework used by the application to higher version, let’s say from .net framework 2 to 3.5

  1. Goto Property Pages of the web site project
    • View Menu->Property Pages or press shift+F4
  2. Click the Build option from the left side
    • Make sure the Target Framework is .Net Framework 3.5

Second, remove the namespace that shown in the warning in this case the “System.Xml.Linq” from the web.config

namespacelinq

namespace linq


, , , ,

No Comments


What is a Namespace?

It is a Collection of names wherein each name is Unique.
They form the logical boundary for a Group of classes.
Namespace must be specified in Project-Properties.

, ,

No Comments


How to Enumerate SQL Server Instance

To Enumerate or detect installed SQL Server in the Local Network use System.Data.Sql Namespace;

Imports System.Data
Imports System.Data.Sql

Public Function getSqlInstance() as DataTable

sDim sqlEnum As Sql.SqlDataSourceEnumerator

sDim dt As DataTable

sqlEnum = Sql.SqlDataSourceEnumerator.Instance

dt = sqlEnum.GetDataSources

Return dt


End Function

Columns:
ServerName – Name of the server.
InstanceName – Name of the server instance. Blank if the server is running as the default instance.
IsClustered – Indicates whether the server is part of a cluster.
Version – Version of the server (8.00.x for SQL Server 2000, and 9.00.x for SQL Server 2005).

Enumeration Limitations

All of the available servers may or may not be listed. The list can vary depending on factors such as timeouts and network traffic. This can cause the list to be different on two consecutive calls. Only servers on the same network will be listed. Broadcast packets typically won’t traverse routers, which is why you may not see a server listed, but it will be stable across calls.

Listed servers may or may not have additional information such as IsClustered and version. This is dependent on how the list was obtained. Servers listed through the SQL Server browser service will have more details than those found through the Windows infrastructure, which will list only the name.

, ,

No Comments



SetPageWidth