Line break VB.NET - DOTNET
This is a discussion on Line break VB.NET - DOTNET ; 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 ...
-
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>
-
Re: Line break VB.NET
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" <dancer@microsoft.com> wrote in message news:%23zC1WgCwHHA.1188@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>
>
>
-
Re: Line break VB.NET
On Jul 7, 2:29 am, "Juan T. Llibre" <nomailrepl...@nowhere.com> wrote:
> 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>")
-
Re: Line break VB.NET
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" <alexey.smirnov> wrote in message
news:1183796364.302263.31860@n60g2000hse.googlegroups.com...
On Jul 7, 2:29 am, "Juan T. Llibre" <nomailrepl...@nowhere.com> wrote:
> 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>")
-
Re: Line break VB.NET
On Jul 7, 2:48 pm, "Juan T. Llibre" <nomailrepl...@nowhere.com> wrote:
> I must be getting lysdexic in my advanced age.
>
it happens to me all the time, never mind :-)
Similar Threads
-
By Application Development in forum CSharp
Replies: 4
Last Post: 12-14-2007, 07:14 AM
-
By Application Development in forum Adobe Indesign
Replies: 10
Last Post: 01-02-2007, 03:52 PM
-
By Application Development in forum Adobe Indesign
Replies: 0
Last Post: 01-02-2007, 01:19 PM
-
By Application Development in forum Adobe Indesign
Replies: 0
Last Post: 01-02-2007, 01:13 PM
-
By Application Development in forum XML SOAP
Replies: 7
Last Post: 10-20-2006, 12:36 PM