Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Line break VB.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dancer - 07 Jul 2007 00:48 GMT
Using VB.Net and ASP.Net 1.1

Here is a VERY simple MS Access database request.

How can I get a line break between the name, address, & city fields when
they are written?

& vbCrLf _ returns an error of   " End of statement expected."

<%@ Page Language="VB" %>

<%@ Import Namespace="System.Data.Oledb" %>

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

Dim DBConnection As OledbConnection

DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0;" & _

"Data Source=C:\Inetpub\wwwroot\Experiment.mdb" )

DBConnection.Open()

Dim DBCommand As OledbCommand

DBCommand = New OledbCommand("SELECT * FROM table1, Experiment")

Dim SQLString AS String

SQLString = "SELECT * FROM Table1"

DBCommand = New OleDBCommand(SQLString, DBConnection)

Dim DBReader AS OledbDatareader

DBReader = DBCommand.ExecuteReader()

While DBReader.Read()

Response.Write("Name is " & DBReader("Name"))
Response.Write(DBReader("Address1"))

Response.Write(DBReader("city"))

End While

DBReader.Close()

DBConnection.Close()

End Sub

</script>

</head>

<body>

<form id="form1" runat="server">

</form>

</body>

</html>
Juan T. Llibre - 07 Jul 2007 01:29 GMT
You don't need the ampersand. Just use :

DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0;"  _
"Data Source=C:\Inetpub\wwwroot\Experiment.mdb" )

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> Using VB.Net and ASP.Net 1.1
>
[quoted text clipped - 62 lines]
>
> </html>
Alexey Smirnov - 07 Jul 2007 09:19 GMT
> You don't need the ampersand. Just use :
>
[quoted text clipped - 5 lines]
> foros de asp.net, en espa?ol :http://asp.net.do/foros/
> ======================================

You need the ampersand.

Regarding line break

Response.Write("Name is " & DBReader("Name") & "<br>")
Response.Write(DBReader("Address1") & "<br>")
Response.Write(DBReader("city") & "<br>")
Juan T. Llibre - 07 Jul 2007 13:48 GMT
I must be getting lysdexic in my advanced age.

Sorry for the crossed wire.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
On Jul 7, 2:29 am, "Juan T. Llibre" <nomailrepl...@nowhere.com> wrote:
> You don't need the ampersand. Just use :
>
[quoted text clipped - 5 lines]
> foros de asp.net, en español :http://asp.net.do/foros/
> ======================================

You need the ampersand.

Regarding line break

Response.Write("Name is " & DBReader("Name") & "<br>")
Response.Write(DBReader("Address1") & "<br>")
Response.Write(DBReader("city") & "<br>")
Alexey Smirnov - 07 Jul 2007 13:58 GMT
> I must be getting lysdexic in my advanced age.

it happens to me all the time, never mind :-)

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.