|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problems with referencesImports System Imports System.Data Imports System.Data.SqlTypes Imports System.Data.SqlClient Public Class DataSourceDB Private _Descr, _CsvFileName, _XSLTransform As SqlString Private _dsID, _errorCode As SqlInt32 Private _mainConnection As SqlConnection Private _rowsAffected As Int32 Public Sub New() _mainConnection = New SqlConnection _mainConnection.ConnectionString = cnString End Sub The first error says: Namespace or type specified in the Imports 'System.Data.SqlTypes' 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. However, when I try to add a reference to the project, System.Data.Sqltypes is not a choice in the .NET tab. The datatype SqlConnection has the following error: Reference required to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' containing the base class 'System.ComponentModel.Component'. Add one to your project. But there already is a reference to System in the project! What am I missing here? TIA, Lars Which version of the .Net framework are you running? I took your code and
copied it and pasted it into a new class in VS2005, and it worked fine. I'm using .Net 2.0. Also, what version of SQLServer are you using? Robin <larc***@yahoo.com> wrote in message Show quoteHide quote news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... > The following code snippet has reference errors: > > Imports System > Imports System.Data > Imports System.Data.SqlTypes > Imports System.Data.SqlClient > > Public Class DataSourceDB > > Private _Descr, _CsvFileName, _XSLTransform As SqlString > Private _dsID, _errorCode As SqlInt32 > Private _mainConnection As SqlConnection > Private _rowsAffected As Int32 > > Public Sub New() > _mainConnection = New SqlConnection > _mainConnection.ConnectionString = cnString > End Sub > > The first error says: > Namespace or type specified in the Imports 'System.Data.SqlTypes' > 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. > > However, when I try to add a reference to the project, > System.Data.Sqltypes is not a choice in the .NET tab. > > The datatype SqlConnection has the following error: > Reference required to assembly 'System, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' > containing the base class 'System.ComponentModel.Component'. Add one to > your project. > > But there already is a reference to System in the project! > > What am I missing here? > > TIA, Lars > Robin,
I'm using .Net 2.0 with SQL Server 2005. RobinS wrote: Show quoteHide quote > Which version of the .Net framework are you running? I took your code and > copied it and pasted it into a new class in VS2005, and it worked fine. I'm > using .Net 2.0. > > Also, what version of SQLServer are you using? > > Robin > > <larc***@yahoo.com> wrote in message > news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... > > The following code snippet has reference errors: > > > > Imports System > > Imports System.Data > > Imports System.Data.SqlTypes > > Imports System.Data.SqlClient > > > > Public Class DataSourceDB > > > > Private _Descr, _CsvFileName, _XSLTransform As SqlString > > Private _dsID, _errorCode As SqlInt32 > > Private _mainConnection As SqlConnection > > Private _rowsAffected As Int32 > > > > Public Sub New() > > _mainConnection = New SqlConnection > > _mainConnection.ConnectionString = cnString > > End Sub > > > > The first error says: > > Namespace or type specified in the Imports 'System.Data.SqlTypes' > > 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. > > > > However, when I try to add a reference to the project, > > System.Data.Sqltypes is not a choice in the .NET tab. > > > > The datatype SqlConnection has the following error: > > Reference required to assembly 'System, Version=2.0.0.0, > > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' > > containing the base class 'System.ComponentModel.Component'. Add one to > > your project. > > > > But there already is a reference to System in the project! > > > > What am I missing here? > > > > TIA, Lars > > Weird. This is my System.Data dll location and file name. Do you have the
same thing? I think System.Data.SqlTypes is included in the System.Data.dll. Mine is dated 9/23/2005 7:28 AM. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll Also, I assume you're using VS2005? yes? If you bring up the Object Browser in VS2005 and look under System.Data, do you see System.Data.SqlTypes there? Robin <larc***@yahoo.com> wrote in message Show quoteHide quote news:1162421720.569655.96820@e3g2000cwe.googlegroups.com... > Robin, > > I'm using .Net 2.0 with SQL Server 2005. > > RobinS wrote: >> Which version of the .Net framework are you running? I took your code and >> copied it and pasted it into a new class in VS2005, and it worked fine. >> I'm >> using .Net 2.0. >> >> Also, what version of SQLServer are you using? >> >> Robin >> >> <larc***@yahoo.com> wrote in message >> news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... >> > The following code snippet has reference errors: >> > >> > Imports System >> > Imports System.Data >> > Imports System.Data.SqlTypes >> > Imports System.Data.SqlClient >> > >> > Public Class DataSourceDB >> > >> > Private _Descr, _CsvFileName, _XSLTransform As SqlString >> > Private _dsID, _errorCode As SqlInt32 >> > Private _mainConnection As SqlConnection >> > Private _rowsAffected As Int32 >> > >> > Public Sub New() >> > _mainConnection = New SqlConnection >> > _mainConnection.ConnectionString = cnString >> > End Sub >> > >> > The first error says: >> > Namespace or type specified in the Imports 'System.Data.SqlTypes' >> > 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. >> > >> > However, when I try to add a reference to the project, >> > System.Data.Sqltypes is not a choice in the .NET tab. >> > >> > The datatype SqlConnection has the following error: >> > Reference required to assembly 'System, Version=2.0.0.0, >> > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' >> > containing the base class 'System.ComponentModel.Component'. Add one to >> > your project. >> > >> > But there already is a reference to System in the project! >> > >> > What am I missing here? >> > >> > TIA, Lars >> > > Yes, the file is there - System.Data.dll 2.0.50727.42 9/23/2005 6:28AM
I am using VS2005 And I can see System.Data.Sqltypes beneath System.Data in the Object Browser! RobinS wrote: Show quoteHide quote > Weird. This is my System.Data dll location and file name. Do you have the > same thing? I think System.Data.SqlTypes is included in the System.Data.dll. > Mine is dated 9/23/2005 7:28 AM. > C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll > > Also, I assume you're using VS2005? yes? > > If you bring up the Object Browser in VS2005 and look under System.Data, do > you see System.Data.SqlTypes there? > > Robin > > <larc***@yahoo.com> wrote in message > news:1162421720.569655.96820@e3g2000cwe.googlegroups.com... > > Robin, > > > > I'm using .Net 2.0 with SQL Server 2005. > > > > RobinS wrote: > >> Which version of the .Net framework are you running? I took your code and > >> copied it and pasted it into a new class in VS2005, and it worked fine. > >> I'm > >> using .Net 2.0. > >> > >> Also, what version of SQLServer are you using? > >> > >> Robin > >> > >> <larc***@yahoo.com> wrote in message > >> news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... > >> > The following code snippet has reference errors: > >> > > >> > Imports System > >> > Imports System.Data > >> > Imports System.Data.SqlTypes > >> > Imports System.Data.SqlClient > >> > > >> > Public Class DataSourceDB > >> > > >> > Private _Descr, _CsvFileName, _XSLTransform As SqlString > >> > Private _dsID, _errorCode As SqlInt32 > >> > Private _mainConnection As SqlConnection > >> > Private _rowsAffected As Int32 > >> > > >> > Public Sub New() > >> > _mainConnection = New SqlConnection > >> > _mainConnection.ConnectionString = cnString > >> > End Sub > >> > > >> > The first error says: > >> > Namespace or type specified in the Imports 'System.Data.SqlTypes' > >> > 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. > >> > > >> > However, when I try to add a reference to the project, > >> > System.Data.Sqltypes is not a choice in the .NET tab. > >> > > >> > The datatype SqlConnection has the following error: > >> > Reference required to assembly 'System, Version=2.0.0.0, > >> > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' > >> > containing the base class 'System.ComponentModel.Component'. Add one to > >> > your project. > >> > > >> > But there already is a reference to System in the project! > >> > > >> > What am I missing here? > >> > > >> > TIA, Lars > >> > > > Yes, the file is there - System.Data.dll 2.0.50727.42 9/23/2005 6:28AM
I am using VS2005 And I can see System.Data.Sqltypes beneath System.Data in the Object Browser! RobinS wrote: Show quoteHide quote > Weird. This is my System.Data dll location and file name. Do you have the > same thing? I think System.Data.SqlTypes is included in the System.Data.dll. > Mine is dated 9/23/2005 7:28 AM. > C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll > > Also, I assume you're using VS2005? yes? > > If you bring up the Object Browser in VS2005 and look under System.Data, do > you see System.Data.SqlTypes there? > > Robin > > <larc***@yahoo.com> wrote in message > news:1162421720.569655.96820@e3g2000cwe.googlegroups.com... > > Robin, > > > > I'm using .Net 2.0 with SQL Server 2005. > > > > RobinS wrote: > >> Which version of the .Net framework are you running? I took your code and > >> copied it and pasted it into a new class in VS2005, and it worked fine. > >> I'm > >> using .Net 2.0. > >> > >> Also, what version of SQLServer are you using? > >> > >> Robin > >> > >> <larc***@yahoo.com> wrote in message > >> news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... > >> > The following code snippet has reference errors: > >> > > >> > Imports System > >> > Imports System.Data > >> > Imports System.Data.SqlTypes > >> > Imports System.Data.SqlClient > >> > > >> > Public Class DataSourceDB > >> > > >> > Private _Descr, _CsvFileName, _XSLTransform As SqlString > >> > Private _dsID, _errorCode As SqlInt32 > >> > Private _mainConnection As SqlConnection > >> > Private _rowsAffected As Int32 > >> > > >> > Public Sub New() > >> > _mainConnection = New SqlConnection > >> > _mainConnection.ConnectionString = cnString > >> > End Sub > >> > > >> > The first error says: > >> > Namespace or type specified in the Imports 'System.Data.SqlTypes' > >> > 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. > >> > > >> > However, when I try to add a reference to the project, > >> > System.Data.Sqltypes is not a choice in the .NET tab. > >> > > >> > The datatype SqlConnection has the following error: > >> > Reference required to assembly 'System, Version=2.0.0.0, > >> > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' > >> > containing the base class 'System.ComponentModel.Component'. Add one to > >> > your project. > >> > > >> > But there already is a reference to System in the project! > >> > > >> > What am I missing here? > >> > > >> > TIA, Lars > >> > > > Does the error happen at runtime, or when you Build?
What does your connection string look like? Robin <larc***@yahoo.com> wrote in message Show quoteHide quote news:1162484093.745923.23050@h48g2000cwc.googlegroups.com... > Yes, the file is there - System.Data.dll 2.0.50727.42 9/23/2005 6:28AM > I am using VS2005 > And I can see System.Data.Sqltypes beneath System.Data in the Object > Browser! > > RobinS wrote: >> Weird. This is my System.Data dll location and file name. Do you have the >> same thing? I think System.Data.SqlTypes is included in the >> System.Data.dll. >> Mine is dated 9/23/2005 7:28 AM. >> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll >> >> Also, I assume you're using VS2005? yes? >> >> If you bring up the Object Browser in VS2005 and look under System.Data, >> do >> you see System.Data.SqlTypes there? >> >> Robin >> >> <larc***@yahoo.com> wrote in message >> news:1162421720.569655.96820@e3g2000cwe.googlegroups.com... >> > Robin, >> > >> > I'm using .Net 2.0 with SQL Server 2005. >> > >> > RobinS wrote: >> >> Which version of the .Net framework are you running? I took your code >> >> and >> >> copied it and pasted it into a new class in VS2005, and it worked >> >> fine. >> >> I'm >> >> using .Net 2.0. >> >> >> >> Also, what version of SQLServer are you using? >> >> >> >> Robin >> >> >> >> <larc***@yahoo.com> wrote in message >> >> news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... >> >> > The following code snippet has reference errors: >> >> > >> >> > Imports System >> >> > Imports System.Data >> >> > Imports System.Data.SqlTypes >> >> > Imports System.Data.SqlClient >> >> > >> >> > Public Class DataSourceDB >> >> > >> >> > Private _Descr, _CsvFileName, _XSLTransform As SqlString >> >> > Private _dsID, _errorCode As SqlInt32 >> >> > Private _mainConnection As SqlConnection >> >> > Private _rowsAffected As Int32 >> >> > >> >> > Public Sub New() >> >> > _mainConnection = New SqlConnection >> >> > _mainConnection.ConnectionString = cnString >> >> > End Sub >> >> > >> >> > The first error says: >> >> > Namespace or type specified in the Imports 'System.Data.SqlTypes' >> >> > 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. >> >> > >> >> > However, when I try to add a reference to the project, >> >> > System.Data.Sqltypes is not a choice in the .NET tab. >> >> > >> >> > The datatype SqlConnection has the following error: >> >> > Reference required to assembly 'System, Version=2.0.0.0, >> >> > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' >> >> > containing the base class 'System.ComponentModel.Component'. Add one >> >> > to >> >> > your project. >> >> > >> >> > But there already is a reference to System in the project! >> >> > >> >> > What am I missing here? >> >> > >> >> > TIA, Lars >> >> > >> > > I got an e-mail from "larclap". He talked to MSFT;
his project file was corrupted. I presume that fixed the problem. Robin S. Show quoteHide quote "RobinS" <RobinS@NoSpam.yah.none> wrote in message news:oKqdnUMY_85E0dfYnZ2dnUVZ_rmdnZ2d@comcast.com... > Does the error happen at runtime, or when you Build? > > What does your connection string look like? > > Robin > > <larc***@yahoo.com> wrote in message > news:1162484093.745923.23050@h48g2000cwc.googlegroups.com... >> Yes, the file is there - System.Data.dll 2.0.50727.42 9/23/2005 6:28AM >> I am using VS2005 >> And I can see System.Data.Sqltypes beneath System.Data in the Object >> Browser! >> >> RobinS wrote: >>> Weird. This is my System.Data dll location and file name. Do you have >>> the >>> same thing? I think System.Data.SqlTypes is included in the >>> System.Data.dll. >>> Mine is dated 9/23/2005 7:28 AM. >>> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll >>> >>> Also, I assume you're using VS2005? yes? >>> >>> If you bring up the Object Browser in VS2005 and look under System.Data, >>> do >>> you see System.Data.SqlTypes there? >>> >>> Robin >>> >>> <larc***@yahoo.com> wrote in message >>> news:1162421720.569655.96820@e3g2000cwe.googlegroups.com... >>> > Robin, >>> > >>> > I'm using .Net 2.0 with SQL Server 2005. >>> > >>> > RobinS wrote: >>> >> Which version of the .Net framework are you running? I took your code >>> >> and >>> >> copied it and pasted it into a new class in VS2005, and it worked >>> >> fine. >>> >> I'm >>> >> using .Net 2.0. >>> >> >>> >> Also, what version of SQLServer are you using? >>> >> >>> >> Robin >>> >> >>> >> <larc***@yahoo.com> wrote in message >>> >> news:1162407872.699283.248820@f16g2000cwb.googlegroups.com... >>> >> > The following code snippet has reference errors: >>> >> > >>> >> > Imports System >>> >> > Imports System.Data >>> >> > Imports System.Data.SqlTypes >>> >> > Imports System.Data.SqlClient >>> >> > >>> >> > Public Class DataSourceDB >>> >> > >>> >> > Private _Descr, _CsvFileName, _XSLTransform As SqlString >>> >> > Private _dsID, _errorCode As SqlInt32 >>> >> > Private _mainConnection As SqlConnection >>> >> > Private _rowsAffected As Int32 >>> >> > >>> >> > Public Sub New() >>> >> > _mainConnection = New SqlConnection >>> >> > _mainConnection.ConnectionString = cnString >>> >> > End Sub >>> >> > >>> >> > The first error says: >>> >> > Namespace or type specified in the Imports 'System.Data.SqlTypes' >>> >> > 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. >>> >> > >>> >> > However, when I try to add a reference to the project, >>> >> > System.Data.Sqltypes is not a choice in the .NET tab. >>> >> > >>> >> > The datatype SqlConnection has the following error: >>> >> > Reference required to assembly 'System, Version=2.0.0.0, >>> >> > Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' >>> >> > containing the base class 'System.ComponentModel.Component'. Add >>> >> > one to >>> >> > your project. >>> >> > >>> >> > But there already is a reference to System in the project! >>> >> > >>> >> > What am I missing here? >>> >> > >>> >> > TIA, Lars >>> >> > >>> > >> > >
tootip or microhelp for menu items
NULL dates show today's date rather than a blank or NULL on form NewBie start a windows service remotely Trouble with a console app Scoping Issues line replacing ideas Looking for online articles/tutorials or good reference books Write an XML node Integrating VS and Visio |
|||||||||||||||||||||||