Okay I managed to do the connection and it works. Here is my issue and if I can 
get this right I can do other simular pages without a problem it is just 
learning that FIRST one that is the hard part the same as classic asp and ADO. 



Here is the old page in asp classic
Basically you click on the ViewBTCMemberIndex.asp page that I have already 
converted with many thanks to Ben Miller and now once that is done it displays 
that members information ...

here is the link to what it looks like now done in classic asp
http://belchingtoadclan.gotdns.com/btc2/_scripts/ViewBTCMemberfromindex.asp?QuakeDealer[BTC]


I used to just open a recordset and get the one record belonging to the member 
and i could access each field value in that row. I cold response.write it and 
display it etc.. I cannot figure out how to do that in asp.net.   Here is the 
code fromt he old page. YOu will see how I could get the record I want and then 
assign the values to variables....... How to do that in asp.net?  


Like how I do this in ado:
strName = objRS("Name") 
strPlayingname = objRS("Playingname")

In ADO.NET:
strName = ???
strPlayingname = ????

I put what I started in asp.net after the current asp classic code Block 
listed. 




<ASPCLASSIC-CODE>
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="adovbs.inc"-->
<!--#include file="DatabaseConnect.asp"-->

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Menu</title>

<STYLE>BODY {
 SCROLLBAR-FACE-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #000000; 
SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; 
SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #000000
}
</style>


<style fprolloverstyle>A:hover {color: #00FF00; font-style: italic}
</style>
</head>

<body bgcolor="#000000" text="#C0C0C0" link="#C0C0C0" vlink="#C0C0C0" 
alink="#00FF00" style="text-align: center">



<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="572">
  <tr>
    <td>
 <!--webbot bot="Include" U-Include="../MenuSystem/Menu.htm" TAG="BODY" --></td>
  </tr>
  <tr>
<%
  'AUTHOR: MIKE BELCHER
  'VIEW MEMBERS
    
%>

<%

'GRAB THE RECORD VALUE FROM THE QUERYSTRING HERE AND PLACE INTO A VARIABLE.
Dim strRecord , arrRecord
strRecord = Request.QueryString
strRecord=Replace(strRecord, "%40", "@")
strRecord=Replace(strRecord, "%2E", ".")
strRecord=Replace(strRecord, "%7E", "~")' put tilde back
strRecord=Replace(strRecord, "%60", "`")' put ` back
strRecord=Replace(strRecord, "%21", "!")' put exclamation back
strRecord=Replace(strRecord, "%40", "@")' put @ back
strRecord=Replace(strRecord, "%23", "#")' put pound back
strRecord=Replace(strRecord, "%24", "$")' put dollar sign back
'strRecord=Replace(strRecord, "%2525", "%")' put percent sign back
strRecord=Replace(strRecord, "%5E", "^")' put exponent back
strRecord=Replace(strRecord, "%26", "&")' put and back
strRecord=Replace(strRecord, "%2A", "*")' put and back
strRecord=Replace(strRecord, "%28", "(")' put ( back
strRecord=Replace(strRecord, "%29", ")")' put ) back
strRecord=Replace(strRecord, "%20", " ")' put spaces back
strRecord=Replace(strRecord, "%2C", ",")' put comma back
strRecord=Replace(strRecord, "%27", "'")' put apostrophe back
strRecord=Replace(strRecord, "%2D", "-")' put dash back
strRecord=Replace(strRecord, "%5F", "_")' put underscore back
strRecord=Replace(strRecord, "%3D", "=")' put equal back
strRecord=Replace(strRecord, "%7B", "{")' put left bracket back
strRecord=Replace(strRecord, "%7D", "}")' put right bracket back
strRecord=Replace(strRecord, "%5B", "[")' put [ back
strRecord=Replace(strRecord, "%5D", "]")' put ] back
strRecord=Replace(strRecord, "%7C", "|")' put | back
strRecord=Replace(strRecord, "%5C", "\")' put \ back
strRecord=Replace(strRecord, "%2F", "/")' put / back
strRecord=Replace(strRecord, "%3A", ":")' put : back
strRecord=Replace(strRecord, "%3B", ";")' put ; back
'strRecord=Replace(strRecord, "%22", """"")' put  back
strRecord=Replace(strRecord, "%3C", "<")' put < back
strRecord=Replace(strRecord, "%3E", ">")' put > back
strRecord=Replace(strRecord, "%2E", ".")' put . back

'create a SQL statement open the recordset
Dim strSQL
strSQL = "SELECT * FROM tblBTC"

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn


'FIND THE RECORD WE WANT   
Dim strShowRecord

 Do While Not (objRS.EOF OR strShowRecord)
  If Not(StrComp(objRS("PlayingName"), strRecord, vbTextCompare) = 0) Then
   'nothing
   objRS.MoveNext
  Else
   strShowRecord = true
  End If
Loop



Dim strName, strPlayingname, strUserName, strPassword, strLocation, strEmail, 
strAge, strIcq, strAim, strOccupation
Dim strBio, strPersonalInformation, strGamesPlayed, strConnect, strProcessor, 
strRam, strVideocard
Dim strSoundcard, strHarddrive, strAdditionalsysteminformation, strPhoto, 
strSystemPhoto, strDateJoined, strOS

strName = objRS("Name") 
strPlayingname = objRS("Playingname")
strUserName = objRS("UserName")
strPassword = objRS("Password")
strLocation = objRS("Location")
strEmail = objRS("Email")
strAge = objRS("Age")
strIcq = objRS("Icq")
strAim = objRS("Aim") 
strOccupation = objRS("Occupation")
strBio = objRS("Bio")
strPersonalInformation = objRS("PersonalInformation")
strGamesPlayed = objRS("GamesPlayed")
strConnect = objRS("Connect")
strProcessor = objRS("Processor")
strRam = objRS("Ram")
strVideocard = objRS("Videocard")
strSoundcard = objRS("Soundcard")
strHarddrive = objRS("Harddrive")
strAdditionalsysteminformation = objRS("Additionalsysteminformation")
strPhoto = objRS("Photo")
strSystemPhoto = objRS("SystemPhoto")
strDateJoined = objRS("DateJoined")
strOS = objRS("OS")


%>


<div align="center">
<table border="0" cellpadding="0" cellspacing="5" width="780" id="table3"><tr>
  <td width="50" valign="top">
 &nbsp;</td><td valign="top">
 &nbsp;</td><td width="50" valign="top">
 &nbsp;</td></tr><tr>
  <td width="50" valign="top" background="../_Images/Development/bg2.gif">
 &nbsp;</td><td valign="top">
 <font face="Verdana" SIZE="4" color="#008000">
 <div align="center">
  <table border="1" cellpadding="0" cellspacing="0" width="100%" align="left" 
id="table4">
   <tr>
    <td background="../_Images/Development/metal3Dark.gif" 
bordercolorlight="#666666" bordercolordark="#333333" bgcolor="#292929">
    <font face="Verdana" SIZE="4">
    <div align="center">
     <table border="0" cellpadding="0" cellspacing="0" width="100%" 
align="left" id="table6">
      <tr>
       <td colspan="4"><font face="Verdana" SIZE="4">
       <strong><big><big><big><font size="6"><%=strPlayingname 
%></font></big></big></big></strong></font></td>
      </tr>
      <tr>
       <td width="100%" colspan="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       </td>
      </tr>
      <tr>
       <td width="1%">&nbsp;</td>
       <td width="30%" colspan="2">
 <font face="Verdana" SIZE="4" color="#008000">
       <div align="center">
  <table border="1" cellpadding="0" cellspacing="0" id="table7" 
bordercolorlight="#666666" bordercolordark="#333333" bgcolor="#000000">
   <tr>
    <td>
      <img border="0" src="<%=strPhoto %>" width="166" height="166"></td>
   </tr>
  </table>
  </font>
 </div></td>
 <font face="Verdana" SIZE="4" color="#008000">
    <font face="Verdana" SIZE="3">
       <td width="69%" valign="top">
       <font face="Verdana" SIZE="3" color="#008000">
       <b>JOINED: </b><font color="#00FF00"><%=strDateJoined %></font><br>
       <b>NAME: </b><font color="#00FF00"><%=strName %><br>
       </font><b>AGE:</b> <font color="#00FF00"><%=strAge %><br>
       </font><b>
 LOCATION:</b> <font color="#00FF00"><%=strLocation %></font><br><b>
 PLAYING&nbsp; NAME:</b> <font color="#00FF00"><%=strPlayingname %></font><br>
 <b>EMAIL:</b> <font color="#00FF00"><a href='mailto:<%=strEmail 
%>'><%=strEmail %></a></font><br>
 <b>AIM:</b> <font color="#00FF00"><A href="aim:goim?screenname=<%=strAim 
%>"><%=strAim %></A></font><br>
       <b>
 ICQ:</b> <font color="#00FF00"><%=strIcq %></font>
 <br><b>OCCUPATION:</b> <font color="#00FF00"><%=strOccupation %></font></td>
      </tr>
      <tr>
       <td width="100%" colspan="4">&nbsp;&nbsp;&nbsp; </td>
      </tr>
      <tr>
       <td width="100%" colspan="4">
 <font face="Verdana" SIZE="4" color="#008000">
       <b>BIO:</b><BR><font color="#00FF00"><%=strBio %></font><br><br>
       
       <b>PERSONAL INFORMATION:</b><BR><font 
color="#00FF00"><%=strPersonalInformation %></font><br><br>
       
       <b>GAMES PLAYED:<br></b>
    <font face="Verdana" SIZE="4" color="#00FF00"><%=strGamesPlayed 
%></font><br><br>&nbsp;</td>
      </tr>
      <tr>
       <td width="100%" colspan="4">
 <b>
 <font face="Verdana" SIZE="5" color="#1079AD">SYSTEM 
INFORMATION</font></b></td>
      </tr>
      <tr>
       <td width="100%" colspan="4">
 &nbsp;&nbsp; </td>
      </tr>
      <tr>
       <td width="20" colspan="2">
 &nbsp;</td>
       <td width="30%">
 <font face="Verdana" SIZE="4" color="#008000">
       <div align="center">
  <table border="1" cellpadding="0" cellspacing="0" align="center" id="table8" 
bordercolorlight="#666666" bordercolordark="#333333" bgcolor="#000000">
   <tr>
    <td>
      <img border="0" src="<%=strSystemPhoto %>" width="166" height="166"></td>
   </tr>
  </table>
 </div></td>
       <td valign="top">
 <b><font color="#FF00FF" face="Verdana"><br>
 </font><font color="#1079AD" face="Verdana">CONNECTION:</font></b><font 
color="#FF00FF" face="Verdana"> 
 <font color="#31F7FF"><%=strConnect %></font><br></font>
 
 <font color="#1079AD" face="Verdana"><b>OPERATING SYSTEM:</b></font><font 
color="#FF00FF" face="Verdana"> 
 <font color="#31F7FF"><%=strOS %></font><br>
 
 </font><font color="#1079AD" face="Verdana"><b>PROCESSOR:</b></font><font 
color="#FF00FF" face="Verdana"> 
 <font color="#31F7FF"><%=strProcessor %></font><br>
 
 </font><font color="#1079AD" face="Verdana"><b>RAM:</b></font><font 
color="#FF00FF" face="Verdana"> 
 <font color="#31F7FF"><%=strRam %></font><br></font>
 
 
 <font color="#1079AD" face="Verdana"><b>
 VIDEO CARD:</b></font><font color="#FF00FF" face="Verdana"> 
 <font color="#31F7FF"><%=strVideocard %></font><br></font>
 
 <font color="#1079AD" face="Verdana"><b>
 SOUND CARD:</b></font><font color="#FF00FF" face="Verdana"> 
 <font color="#31F7FF"><%=strSoundcard %></font><br></font>
 
 <font color="#1079AD" face="Verdana"><b>HARD DRIVE:</b></font><font 
color="#FF00FF" face="Verdana">
 </font><font color="#31F7FF" face="Verdana"><%=strHarddrive %></font>
 
 <font color="#FF00FF" face="Verdana"><font color="#FF80FF"><br>
       </font><br>&nbsp;</td>
      </tr>
      <tr>
       <td width="100%" colspan="4">
 <br>
 <font color="#1079AD" face="Verdana" SIZE="4"><b>ADDITIONAL SYSTEM 
INFORMATION:</b></font><font color="#FF00FF" face="Verdana" SIZE="4"><BR>
 </font><font color="#31F7FF" face="Verdana" 
SIZE="4"><%=strAdditionalsysteminformation %></font><font color="#FF00FF" 
face="Verdana" SIZE="4">
 </font><br>
&nbsp;</td>
      </tr>
     </table>
    </div>

    <font face="Verdana"><strong><big><big><big><font size="6"><br>
    <br>
    <br>
    <br>
    <br>
    <br>
    </font></big></big></big></strong></font></font>
    <font face="Verdana" SIZE="4" color="#008000">
    <b><br>
    &nbsp;</b></font><p><br>
    <font face="Verdana" SIZE="4" color="#008000">
    <br><font color="#FF00FF"><br>
 <br></td>
   </tr>
  </table>
 </div>
 <font face="Verdana"><strong><big><big><big><font size="6"><br>
&nbsp;</font></big></big></big></strong></font></td>
  <td width="50" valign="top" background="../_Images/Development/bg2.gif">
 &nbsp;</td></tr><tr>
  <td width="50" valign="top">
 &nbsp;</td><td valign="top">
 &nbsp;</td><td width="50" valign="top">
 &nbsp;</td></tr></table>




</div>
   <!--webbot bot="Include" U-Include="../MenuSystem/Footer.htm" TAG="BODY" -->

</body>

</html>



<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing

Dim strLink
strLink = ""
%>




</table>
</div>

</BODY>
</HTML>

</ASPCLASSIC-CODE>







</ASP.NET-CODE>


'Open the Connection -------------------------------------

Dim objConn As OleDbConnection

Dim objConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data 
Source=C:\Inetpub\wwwroot\btcNET\DB\belcherman.mdb"

objConn = New OleDb.OleDbConnection(objConnString)

objConn.Open()

'Response.Write("Connection OPENED <BR><BR>")

'Open the Connection -------------------------------------



'Create a DataSet ----------------------------------------

Dim objDataSet As New DataSet

'Response.Write("objDataSet Created <BR><BR>")

'Create a DataSet ----------------------------------------

'---------- Get Playingname from Querystring ------

Dim strPlayingName As String

strPlayingName = Request.QueryString("PlayingName")



Dim strSQLstring As String

strSQLstring = "SELECT * FROM tblBTC WHERE PlayingName LIKE '" & strPlayingName 
& "'"

'--------------------------------









'Create a DataAdapter ------------------------------------

Dim objDataAdapter As OleDbDataAdapter

'objDataAdapter = New OleDbDataAdapter("SELECT * FROM tblBTC", objConn)

objDataAdapter = New OleDbDataAdapter(strSQLstring, objConn)

objDataAdapter.Fill(objDataSet, "BTC MEMBERS")

'Response.Write("objDataAdapter Created and used to fill the the objDataSet 
with tblBTC <BR><BR>")

'Create a DataAdapter ------------------------------------





'CODE ===============================================================

'tblBTC.DataSource = objDataSet

'tblBTC.DataBind()

'literal1.text = " HTML CODE "

'Want to add more:

'literal1.text &= " MORE HTML CODE "

'<%# DataBinder.Eval(Container.DataItem, "PlayingName") %>











Dim tblBTC As DataTable = objDataSet.Tables.Item("tblBTC")

'tblBTC.Rows.Item("PlayingName")





strBTC.Text = " HTML CODE <BR>"

strBTC.Text &= " -------- HTML CODE added again<BR>"

strBTC.Text &= "PlayingName = " & strPlayingName & "<BR>"

strBTC.Text &= "SQLString = " & strSQLstring & "<BR>"

strBTC.Text &= "DATAITEM ==== " & 
objDataSet.Tables("tblBTC").Rows.Item("PlayingName").ToString()





'Console.WriteLine(rowCustomer.Item("CompanyName"))

'objDataSet.Tables("tblBTC").Rows.Item("PlayingName").ToString()

'objDataSet.Tables("tblBTC").Rows.

'objDataSet.Tables("tblBTC").Rows.Item("PlayingName").ToString())

'objDataSet.Tables("tblBTC").Columns.



'CODE ===============================================================









'Close things up ------------------------------------

objDataSet.Dispose()

objDataSet = Nothing

objDataAdapter = Nothing

objConn.Close()

objConn = Nothing

'Response.Write("CLOSED <BR><BR>")

'Close things up ------------------------------------





'----------------------------- Script extras ----------------------

'strSQLstring = "SELECT * FROM tblBTC WHERE PlayingName LIKE '%strPlayingName%'"

'---------------------------------------------------------------------------

</ASP.NET-CODE>




I have tried and looked around but so far nothing is like what i need. 


Mike Belcher
Independent Computer Consultant
Email: [EMAIL PROTECTED]



[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to