473,835 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Declaration Expected?

Still learning ASP.NET....(and I was getting so good with classic ASP too!).

I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot
get past this "error".

Can anyone see the error? This <script> example is almost line by line from
the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***

Nov 18 '05 #1
9 5040
what is the error?
-----Original Message-----
Still learning ASP.NET....(and I was getting so good with classic ASP too!).
I'm trying to connect to a SQL Server using a simple connection script.I've checked 2 different books and looked at www.asp.net and still cannotget past this "error".

Can anyone see the error? This <script> example is almost line by line fromthe Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.
Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRP T-TEST")
************** *************** *****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST") DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn) RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitle d Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Wri te RS("LastName"). Value

DbConn.Close ()
RS.Close()
%>
</body>
</html>

--
************** *************** ****
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
************** *************** ****

.

Nov 18 '05 #2
Hmm...

Have you tried putting RS.Read after RS.MoveFirst?

Also, once you're getting good with DataReaders, you might want to consider
ditching them in favour of DataSets. Much nicer.

Also - DON'T forget to DbConn.Dispose( )
Regards,
Anth

"D. Shane Fowlkes" <sh***@raccoonb ob.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
Still learning ASP.NET....(and I was getting so good with classic ASP too!).
I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot
get past this "error".

Can anyone see the error? This <script> example is almost line by line from the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***

Nov 18 '05 #3
I included it in my post.

Thx

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***
"Jon Paugh" <an*******@disc ussions.microso ft.com> wrote in message
news:26******** *************** *****@phx.gbl.. .
what is the error?
-----Original Message-----
Still learning ASP.NET....(and I was getting so good with

classic ASP too!).

I'm trying to connect to a SQL Server using a simple

connection script.
I've checked 2 different books and looked at www.asp.net

and still cannot
get past this "error".

Can anyone see the error? This <script> example is

almost line by line from
the Sams ASP.NET Unleashed Book. The error is on line

8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRP T-TEST")
************** *************** *****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3;

database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;",

DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitle d Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Wri te RS("LastName"). Value

DbConn.Close ()
RS.Close()
%>
</body>
</html>

--
************** *************** ****
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
************** *************** ****

.

Nov 18 '05 #4
Yeah...here's the new code but same error. It wants me to "declare" my
DbConn = New SQLConnection.. ..." line. I don't get it.

...frustrated.. .
<% @Page Language = "VB" Debug = "True" Explicit = "True" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html>
<head>
</head>
<body>
<%
RS.MoveFirst
RS.Read()
Response.Write RS("LastName"). Value
DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***
"Anthony Williams" <to**@bigtone.n et> wrote in message
news:OK******** ******@TK2MSFTN GP09.phx.gbl...
Hmm...

Have you tried putting RS.Read after RS.MoveFirst?

Also, once you're getting good with DataReaders, you might want to consider ditching them in favour of DataSets. Much nicer.

Also - DON'T forget to DbConn.Dispose( )
Regards,
Anth

"D. Shane Fowlkes" <sh***@raccoonb ob.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
Still learning ASP.NET....(and I was getting so good with classic ASP

too!).

I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot get past this "error".

Can anyone see the error? This <script> example is almost line by line

from
the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***


Nov 18 '05 #5
unlike asp, only subroutines and functions are allowed in <script
runat=server> blocks. inline code is only allowed in with <% %>

-- bruce (sqlwork.com)

"D. Shane Fowlkes" <sh***@raccoonb ob.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
Still learning ASP.NET....(and I was getting so good with classic ASP too!).
I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot
get past this "error".

Can anyone see the error? This <script> example is almost line by line from the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***

Nov 18 '05 #6
Oh, IC, sorry. Try:

Dim DbConn As new SQLConnection(" server=drpt-
server3; database=DRPT-TEST")
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

Sub Page_Load(Sende r As Object, E As
EventArgs)
DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New SQLCommand("SEL ECT * FROM
Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
End Sub

(you didnt have code in a method and you were trying to
create a MySQLCommand too, which is not a type)
-----Original Message-----
I included it in my post.

Thx

--
************** *************** ****
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
************** *************** ****
"Jon Paugh" <an*******@disc ussions.microso ft.com> wrote in messagenews:26******* *************** ******@phx.gbl. ..
what is the error?
>-----Original Message-----
>Still learning ASP.NET....(and I was getting so good with
classic ASP too!).
>
>I'm trying to connect to a SQL Server using a simple

connection script.
>I've checked 2 different books and looked at
www.asp.net and still cannot
>get past this "error".
>
>Can anyone see the error? This <script> example is

almost line by line from
>the Sams ASP.NET Unleashed Book. The error is on line

8. Thanks.
>
>
>
>Compiler Error Message: BC30188: Declaration expected.
>
>Source Error:
>
>Line 8: DbConn = New SQLConnection(" server=drpt-
server3; >database=DRP T-TEST")
>
>
>************** *************** *****
>
><%@ Import Namespace="Syst em.Data.SqlClie nt" %>
>
><script runat="server">
> Dim DbConn As SQLConnection
> Dim MySQLCommand As SQLCommand
> Dim RS As SQLDataReader
>
> DbConn = New SQLConnection(" server=drpt-server3;

database=DRPT-TEST")
> DbConn.Open()
>
> MySQLCommand = New MySQLCommand("S ELECT * FROM

Staff;", DbConn)
> RS = MySQLCommand.Ex ecuteReader()
></script>
>
><html xmlns="http://www.w3.org/1999/xhtml">
><head>
><title>Untitle d Document</title>
></head>
><body>
><%
>RS.MoveFirst
>Response.Wri te RS("LastName"). Value
>
>DbConn.Close ()
>RS.Close()
> %>
></body>
></html>
>
>--
>
>
>************** *************** ****
>D. Shane Fowlkes - TMM
>Saving the world, one web site at a time.
>http://www.shanefowlkes.com
>************** *************** ****
>
>
>
>.
>

.

Nov 18 '05 #7
OK...So, why use <script> tags at all? Why not always use <% %>? Is there
really an advantage?

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***
"bruce barker" <no***********@ safeco.com> wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl...
unlike asp, only subroutines and functions are allowed in <script
runat=server> blocks. inline code is only allowed in with <% %>

-- bruce (sqlwork.com)

"D. Shane Fowlkes" <sh***@raccoonb ob.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
Still learning ASP.NET....(and I was getting so good with classic ASP

too!).

I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot get past this "error".

Can anyone see the error? This <script> example is almost line by line

from
the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***


Nov 18 '05 #8
Here is what worked for me on a parameterized stored proc named
spExecuteGeneri c which takes 2 parameters: @SQLQuery -A query (which is
deceptively named AuthorID) and ReturnVal, a returntype parameter Which
would hold an errror (I think). Hope this helps The biggest problem I had
was the connection string and "Trusted_Connec tion=False;" had to be declared
if I was using a login/pwd. You should probalby change that to true if using
trusted connection and leave off the UserName and PWD pairs

OK so I need to get uptodate on vbcrlf

Private Function fncRunSproc()
Dim MyDataSet As New DataSet("MyData Set")
Dim AuthorID As SqlParameter
Dim ReturnVal As SqlParameter
Dim LoopCount As Integer
Dim NewString As New System.Text.Str ingBuilder
Dim RowCounter As Integer

Dim ConnStr As String = "Server=""Serve rName"";worksta tion
id=""WORKSTATIO N_NAME"";packet size=4096;integ rated security=SSPI;d ata
source=""SERVER NAME\DATABASENA ME"";persist security info=False;init ial
catalog=Pubs;Tr usted_Connectio n=False;User
ID=""LoginName" ";Password=""Pa ssword"""
Dim SQLConn As New SqlConnection(C onnStr)
Dim MySqlCmd As New SqlCommand("spE xecuteGeneric", SQLConn)
MySqlCmd.Comman dType = CommandType.Sto redProcedure
'Dim SQLAdptr As New SqlDataAdapter( MySqlCmd)

txtResults.Text = ""
'txtResults.Ref resh()

AuthorID = New SqlParameter
AuthorID.SqlDbT ype = SqlDbType.VarCh ar
AuthorID.Parame terName = "@SQLQuery"
AuthorID.Direct ion = ParameterDirect ion.Input
AuthorID.Value = txtQuery.Text
MySqlCmd.Parame ters.Add(Author ID)

ReturnVal = New SqlParameter '("RetValue", SqlDbType.Int)
ReturnVal.SqlDb Type = SqlDbType.Int
ReturnVal.Param eterName = "RetValue"
ReturnVal.Direc tion = ParameterDirect ion.ReturnValue
MySqlCmd.Parame ters.Add(Return Val)

SQLConn.Open()

Dim myReader As SqlDataReader
myReader = MySqlCmd.Execut eReader()

NewString.Appen d(Chr(9))

For LoopCount = 0 To myReader.FieldC ount - 1
NewString.Appen d(Trim(myReader .GetName(LoopCo unt).ToString) & Chr(9))
Next

NewString.Appen d(vbCrLf)

Do While myReader.Read
NewString.Appen d("(" & RowCounter & ")" & Chr(9))
RowCounter += 1
For LoopCount = 0 To myReader.FieldC ount - 1
NewString.Appen d(Trim(myReader .GetSqlValue(Lo opCount).ToStri ng) &
Chr(9))
Next

NewString.Appen d(vbCrLf)
Loop

txtResults.Text &= NewString.ToStr ing
myReader.Close( )

txtResults.Text &= "Return Value: " & (ReturnVal.Valu e) & vbCrLf

SQLConn.Close()
End Function
"D. Shane Fowlkes" <sh***@raccoonb ob.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
Still learning ASP.NET....(and I was getting so good with classic ASP too!).
I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot
get past this "error".

Can anyone see the error? This <script> example is almost line by line from the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***

Nov 18 '05 #9
Try ditching RS.MoveFirst and just using:

If RS.Read Then
Response.Write RS("LastName"). Value
End If
"Anthony Williams" <to**@bigtone.n et> wrote in message
news:OK******** ******@TK2MSFTN GP09.phx.gbl...
Hmm...

Have you tried putting RS.Read after RS.MoveFirst?

Also, once you're getting good with DataReaders, you might want to consider ditching them in favour of DataSets. Much nicer.

Also - DON'T forget to DbConn.Dispose( )
Regards,
Anth

"D. Shane Fowlkes" <sh***@raccoonb ob.com> wrote in message
news:O6******** ******@TK2MSFTN GP12.phx.gbl...
Still learning ASP.NET....(and I was getting so good with classic ASP

too!).

I'm trying to connect to a SQL Server using a simple connection script.
I've checked 2 different books and looked at www.asp.net and still cannot get past this "error".

Can anyone see the error? This <script> example is almost line by line

from
the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: DbConn = New SQLConnection(" server=drpt-server3;
database=DRPT-TEST")
*************** *************** ****

<%@ Import Namespace="Syst em.Data.SqlClie nt" %>

<script runat="server">
Dim DbConn As SQLConnection
Dim MySQLCommand As SQLCommand
Dim RS As SQLDataReader

DbConn = New SQLConnection(" server=drpt-server3; database=DRPT-TEST")
DbConn.Open()

MySQLCommand = New MySQLCommand("S ELECT * FROM Staff;", DbConn)
RS = MySQLCommand.Ex ecuteReader()
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
</head>
<body>
<%
RS.MoveFirst
Response.Write RS("LastName"). Value

DbConn.Close()
RS.Close()
%>
</body>
</html>

--
*************** *************** ***
D. Shane Fowlkes - TMM
Saving the world, one web site at a time.
http://www.shanefowlkes.com
*************** *************** ***


Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
16363
by: Ammar_ace | last post by:
Can Somebbody pls help me out here. i am new to .net programming, i am trying to connect to an access database and read, but i get the error message 'BC30188 Declaration Expected' this is what i did 'create the connection object Dim objConn As New System.Data.OLEDB.Connection() .. .. ..
5
4977
by: TJS | last post by:
trying to display pdf file in browser fails on this line: Response.ContentType = "application/pdf" getting an error about no declaration found for "response" what declaration is needed ???
1
3525
by: Chuck Insight | last post by:
Another newbie question. While working on a WEB project, I came across some code that looked promising, but retues an error. The code is: Private Sub Form_Load() The error it produced is: error BC30188: Declaration expected. In a nutshell
3
2274
by: rdi | last post by:
The import statements weren't copy/pasted, but everything INSIDE the class WAS copy pasted from the help file. Starting with the myMail.From line and going down to the SmtpMail.Send line, EVERY line results in a "Declaration Expected" error. -- RDI (remove the exclamation from the email address) Imports System.Web Imports System.Web.Mail
3
3399
by: Steve King | last post by:
I've an error in code I got from a walkthrough that should work just fine. I added a reference to DMO that shows up in the references properly. The Dim line shows no errors but the initialized object shows an 'Declaration Expected' error. What could be happening? Dim oSQLServer As New SQLDMO.SQLServer oSQLServer.Connect("(local)", "myServer", "myPassword") -- Steve King
2
2320
by: phil | last post by:
Hi, When executing this (asp.net 2.0), i get the error: Compiler Error Message: BC30188: Declaration expected. Line 9: Dim dtreader As SqlDataReader Line 10: Line 11: db = new Sqlconnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\access\nemi.mdb") Line 12: Line 13:
1
2009
by: Cirene | last post by:
I'm binding a datagrid to my business object. I get an error that the type 'abcshoppingcart'...is not marked as serializable. So, I added a attribute in the class. But then a blue squiggly appears with 'declaration expected'. Any idea why? Public Class abcshoppingcart Public customer As New abccustomer Public product As New List(Of abcproduct)
1
2659
by: shekhardotnet | last post by:
below testing code gives an error "declaration expected" please suggest Imports System.Data.SqlClient Public Class Form1 Inherits System.Windows.Forms.Form 'Create ADO.NET objects. Private myConn As SqlConnection Private myCmd As SqlCommand
1
9297
by: Stevecb | last post by:
Hello I'm getting the error "Declaration expected" twice in this code... 'Required in all cases when calling API functions Imports System.Runtime.InteropServices 'Required in this example and any API function which 'use a string buffer. Provides the StringBuilder class Imports System.Text
0
9802
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10559
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9343
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7765
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6961
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3990
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3086
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.