B
Bill
Hi All, New to the whole .Net and C# thing but trying.
In classic asp this was simple to fill a table with dynamic content and
hyperlinks.
Here is an example of what I am trying to do in classic asp:
<table width="640" border="0" cellspacing="3" cellpadding="3">
<tr class="mcsmalltextbold">
<td>First Name</td>
<td>Last Name</td>
<td>Phone Number</td>
<td>Email Address</td>
</tr>
<!-- #Include file="ADOVBS.INC" -->
<%
dim db, rs, sql, strFname, strLname, strPhone, strEmail
set db = Server.CreateObject("ADODB.Connection")
dbConnection = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" _
&server.MapPath("\contacts.mdb")";"
db.open dbConnection
set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.CursorType = 2
rs.LockType = 2
sql = "SELECT fname, lname, phone, email FROM tblAddressBook ORDER BY
lname;"
rs.Open sql, db, adOpenForwardOnly, adLockOptimistic
if rs.EOF then
response.write("<p class='errorClass'>There are currently no entries
in the database.</p>")
else
Do until rs.EOF
strFname = rs("fname")
strLname = rs("lname")
strPhone = rs("phone")
strEmail = rs("email")
response.write("<tr class='tableClass'><td>" & strLname & "</td>")
response.write("<td>" & strFname & "</td>")
response.write("<td>" & strPhone & "</td>")
response.write("<td><a href='mailto:" & strEmail & "'>" & strEmail &
"</a></td>")
rs.movenext
loop
end if
rs.close
set rs = nothing
db.close
set db = nothing
%>
</tr>
</table>
So how would I start in ASP.Net using C# ?
I need to do it this way so I get more control over the design.
Unless I am missing something.
In classic asp this was simple to fill a table with dynamic content and
hyperlinks.
Here is an example of what I am trying to do in classic asp:
<table width="640" border="0" cellspacing="3" cellpadding="3">
<tr class="mcsmalltextbold">
<td>First Name</td>
<td>Last Name</td>
<td>Phone Number</td>
<td>Email Address</td>
</tr>
<!-- #Include file="ADOVBS.INC" -->
<%
dim db, rs, sql, strFname, strLname, strPhone, strEmail
set db = Server.CreateObject("ADODB.Connection")
dbConnection = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" _
&server.MapPath("\contacts.mdb")";"
db.open dbConnection
set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.CursorType = 2
rs.LockType = 2
sql = "SELECT fname, lname, phone, email FROM tblAddressBook ORDER BY
lname;"
rs.Open sql, db, adOpenForwardOnly, adLockOptimistic
if rs.EOF then
response.write("<p class='errorClass'>There are currently no entries
in the database.</p>")
else
Do until rs.EOF
strFname = rs("fname")
strLname = rs("lname")
strPhone = rs("phone")
strEmail = rs("email")
response.write("<tr class='tableClass'><td>" & strLname & "</td>")
response.write("<td>" & strFname & "</td>")
response.write("<td>" & strPhone & "</td>")
response.write("<td><a href='mailto:" & strEmail & "'>" & strEmail &
"</a></td>")
rs.movenext
loop
end if
rs.close
set rs = nothing
db.close
set db = nothing
%>
</tr>
</table>
So how would I start in ASP.Net using C# ?
I need to do it this way so I get more control over the design.
Unless I am missing something.