BC30112: 'System.Data.Sql' is a namespace and cannot be used as an exp

Im new to VB.net so I have had a problem while trying to connect my website to my database....

I keep on getting the same error and Im not too sure what has happened... below is the error and compiler output

[code]Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30112: 'System.Data.Sql' is a namespace and cannot be used as an expression.

Source Error:


Line 10: Dim dbconn As New OleDbConnection("Data Source=.MyDatabaseSQL.mssql.somee.com;AttachDbFileName=|DataDirectory|app_dataaspnetdb.mdf;Integrated Security=True;User Instance=True")
Line 11: dbconn.Open()
Line 12: sql="SELECT * FROM aspnet_Memberships"
Line 13: dbcomm=New OleDbCommand(sql,dbconn)
Line 14: dbread=dbcomm.ExecuteReader()

Source File: d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb Line: 12


Show Detailed Compiler Output:


?C:WindowsSysWOW64inetsrv> "C:WindowsMicrosoft.NETFrameworkv4.0.30319vbc.exe" /t:library /utf8output /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Runtime.Serializationv4.0_4.0.0.0__b77a5c561934e089System.Runtime.Serialization.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Designv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Design.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.WebPages.Deploymentv4.0_1.0.0.0__31bf3856ad364e35System.Web.WebPages.Deployment.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModelv4.0_4.0.0.0__b77a5c561934e089System.ServiceModel.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_32System.Webv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xml.Linqv4.0_4.0.0.0__b77a5c561934e089System.Xml.Linq.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Entityv4.0_4.0.0.0__b77a5c561934e089System.Web.Entity.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xmlv4.0_4.0.0.0__b77a5c561934e089System.Xml.dll" /R:"C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaassemblydl3348e0c6ffe3531d0_1419cd01BotDetect.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.IdentityModelv4.0_4.0.0.0__b77a5c561934e089System.IdentityModel.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Configurationv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Activationv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Activation.dll" /R:"C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_global.asax.f1x2faiw.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystemv4.0_4.0.0.0__b77a5c561934e089System.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Activitiesv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Activities.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.ApplicationServicesv4.0_4.0.0.0__31bf3856ad364e35System.Web.ApplicationServices.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Extensionsv4.0_4.0.0.0__31bf3856ad364e35System.Web.Extensions.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.CSharpv4.0_4.0.0.0__b03f5f7f11d50a3aMicrosoft.CSharp.dll" /R:"C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Code.uyyh5419.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_32System.EnterpriseServicesv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.EnterpriseServices.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Corev4.0_4.0.0.0__b77a5c561934e089System.Core.dll" /R:"C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_xgrv2q3r.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.WorkflowServicesv4.0_4.0.0.0__31bf3856ad364e35System.WorkflowServices.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Data.DataSetExtensionsv4.0_4.0.0.0__b77a5c561934e089System.Data.DataSetExtensions.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Activitiesv4.0_4.0.0.0__31bf3856ad364e35System.Activities.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.DynamicDatav4.0_4.0.0.0__31bf3856ad364e35System.Web.DynamicData.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ComponentModel.DataAnnotationsv4.0_4.0.0.0__31bf3856ad364e35System.ComponentModel.DataAnnotations.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Servicesv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.Services.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Drawingv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_32System.Datav4.0_4.0.0.0__b77a5c561934e089System.Data.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Webv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Web.dll" /out:"C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.dll" /D:DEBUG=1 /debug+ /nowarn:41008 /define:_MYTYPE="Web" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Collections.Specialized,System.ComponentModel.DataAnnotations,System.Configuration,System.Linq,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.DynamicData,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls,System.Xml.Linq,BotDetect,BotDetect.Web,BotDetect.Web.UI /warnaserror- /optionInfer+ "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.12.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.0.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.5.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.10.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.1.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.4.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.2.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.3.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.8.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.6.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.9.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.11.vb" "C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
oot72f33877416facdaApp_Web_qwge3cei.7.vb"


Microsoft (R) Visual Basic Compiler version 10.0.30319.233
Copyright (c) Microsoft Corporation. All rights reserved.

d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(12) : error BC30112: 'System.Data.Sql' is a namespace and cannot be used as an expression.

sql="SELECT * FROM aspnet_Memberships"
~~~
d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(13) : error BC30451: 'dbcomm' is not declared. It may be inaccessible due to its protection level.

dbcomm=New OleDbCommand(sql,dbconn)
~~~~~~
d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(13) : error BC30112: 'System.Data.Sql' is a namespace and cannot be used as an expression.

dbcomm=New OleDbCommand(sql,dbconn)
~~~
d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(14) : error BC30451: 'dbread' is not declared. It may be inaccessible due to its protection level.

dbread=dbcomm.ExecuteReader()
~~~~~~
d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(14) : error BC30451: 'dbcomm' is not declared. It may be inaccessible due to its protection level.

dbread=dbcomm.ExecuteReader()
~~~~~~
d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(15) : error BC30451: 'dbread' is not declared. It may be inaccessible due to its protection level.

customers.DataSource=dbread
~~~~~~
d:DZHostsLocalUser imobiswww.timternet.somee.commemberspageprofile.aspx.vb(17) : error BC30451: 'dbread' is not declared. It may be inaccessible due to its protection level.

dbread.Close()
~~~~~~ [/code]

The url of the page is:
www.timternet.cu.cc/memberspage/profile.aspx

Thanks in advance for any replies, also if someone does reply could you explain a little so I am actually learning and not just stealing code :) thhhaaannnkkkkssss
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories