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
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_data\aspnetdb.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:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb Line: 12
Show Detailed Compiler Output:
C:\Windows\SysWOW64\inetsrv> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Design\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\assembly\dl3\348e0c6f\fe3531d0_1419cd01\BotDetect.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_global.asax.f1x2faiw.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Code.uyyh5419.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_xgrv2q3r.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_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:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.12.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.0.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.5.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.10.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.1.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.4.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.2.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.3.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.8.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.6.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.9.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.11.vb" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\72f33877\416facda\App_Web_qwge3cei.7.vb"
Microsoft (R) Visual Basic Compiler version 10.0.30319.233
Copyright (c) Microsoft Corporation. All rights reserved.
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(12) : error BC30112: 'System.Data.Sql' is a namespace and cannot be used as an expression.
sql="SELECT * FROM aspnet_Memberships"
~~~
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(13) : error BC30451: 'dbcomm' is not declared. It may be inaccessible due to its protection level.
dbcomm=New OleDbCommand(sql,dbconn)
~~~~~~
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(13) : error BC30112: 'System.Data.Sql' is a namespace and cannot be used as an expression.
dbcomm=New OleDbCommand(sql,dbconn)
~~~
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(14) : error BC30451: 'dbread' is not declared. It may be inaccessible due to its protection level.
dbread=dbcomm.ExecuteReader()
~~~~~~
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(14) : error BC30451: 'dbcomm' is not declared. It may be inaccessible due to its protection level.
dbread=dbcomm.ExecuteReader()
~~~~~~
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(15) : error BC30451: 'dbread' is not declared. It may be inaccessible due to its protection level.
customers.DataSource=dbread
~~~~~~
d:\DZHosts\LocalUser\timobis\www.timternet.somee.com\memberspage\profile.aspx.vb(17) : error BC30451: 'dbread' is not declared. It may be inaccessible due to its protection level.
dbread.Close()
~~~~~~
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