473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Line break VB.NET

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>
Jul 6 '07 #1
4 4213
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/
======================================
"dancer" <da****@microsoft.comwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
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>


Jul 7 '07 #2
On Jul 7, 2:29 am, "Juan T. Llibre" <nomailrepl...@nowhere.comwrote:
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/
======================================
You need the ampersand.

Regarding line break

Response.Write("Name is " & DBReader("Name") & "<br>")
Response.Write(DBReader("Address1") & "<br>")
Response.Write(DBReader("city") & "<br>")

Jul 7 '07 #3
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/
======================================
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@n60g2000hse.googlegro ups.com...
On Jul 7, 2:29 am, "Juan T. Llibre" <nomailrepl...@nowhere.comwrote:
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/
======================================
You need the ampersand.

Regarding line break

Response.Write("Name is " & DBReader("Name") & "<br>")
Response.Write(DBReader("Address1") & "<br>")
Response.Write(DBReader("city") & "<br>")
Jul 7 '07 #4
On Jul 7, 2:48 pm, "Juan T. Llibre" <nomailrepl...@nowhere.comwrote:
I must be getting lysdexic in my advanced age.
it happens to me all the time, never mind :-)

Jul 7 '07 #5

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

Similar topics

1
by: Roland Dalmulder | last post by:
Hello all, In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to extract the next part of the string. This goes all...
19
by: les_ander | last post by:
Hi, suppose I am reading lines from a file or stdin. I want to just "peek" in to the next line, and if it starts with a special character I want to break out of a for loop, other wise I want to...
6
by: Jonathan | last post by:
I want to save textarea contents to a mysql database with the paragraph breaks intact without having to type paragraph or break tags in HTML. How can I do that. So far, although it occurs naturally...
4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
6
by: Nurchi BECHED | last post by:
Hello, All! I have created an application with a multiline textbox on the form. When I press a button, it has to show something and then break the line and show something else. I tried "\n",...
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
10
by: Itaichuk | last post by:
Hi I read in several CSS tutorials that block-level elements, such as <div& <pare rendered with an implicit line break before and after. I set to test this out using the following HTML: I...
16
by: lovecreatesbea... | last post by:
It takes mu so time to finish this C source code line count function. What do you think about it? / ******************************************************************************* * Function ...
7
by: jeddiki | last post by:
Hi, I am using a function called htmlwrap() which states that it does NOT add a "<br>" to the 70 character line so that it forces a line wrap. ( the script safely wraps long words without...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.