mkleinosky
Mar 9th, 2003, 08:24 AM
I want to hire someone to do (hopefully) 30 minutes work
converting an ASP program to ASP.NET.
I want to use it to learn the migration.
The site is one I do for free for Americans playing softball in Egypt.
I have written tons of ASP code processing access databases and want to try it with ASP.NET
I don't know how to do the looping in .NET to accomplish the 2 passes throught the database - it reads a list of 'umpires' of the games - they can be either PLATE of FIELD UMPIRE.
Then, for EACH UMPIRE, it goes through database again, printing a report of each game they ump'd.
I can send a check or gifts from Egypt as payment. Please advise (low cost) bid/estimate or just do it.
you can see it in action at http://caslcairo.com/caslumps2003s.asp
the code follows:
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!-- #INCLUDE FILE = "adovbs.asp" -->
<%
Const strTABLENAME = "casl2003s"
Const strMAPPATH = "../../database/casl2003s1"
Const strTITLE = "CASL Spring 2003 "
Const strDEBUG = "n"
%>
<HTML><HEAD><TITLE><%=strTitle%> Umpires</TITLE>
<link rel="stylesheet" href="caslstyle1.css" TYPE = "text/css">
</HEAD>
<BODY>
<!-- #INCLUDE FILE = "inccasltop1.asp" -->
<!-- #INCLUDE FILE = "inccaslmenu1.asp" -->
<H1><%=strTitle%> Umpires</H1>
Please note this report does not include "Shadow Umpires"<HR>
<%
Dim FieldU, plateu, gametime, gdate, fld, NUMRECS, strNeedAnd
Dim league, home, away, scorer, i, strFound
Dim arrUmps (25), strPB
Dim nCounts, strSOLO
Dim objConn, DSNTemp, objRS, MySQL
Set objConn = Server.CreateObject("ADODB.Connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & Server.MapPath(strMAPPATH)
'''''''''response.write DSNTEMP
objConn.Open DSNtemp
Set objRS = Server.CreateObject("ADODB.Recordset")
MySQL= "Select * from " & strTABLENAME & _
" "
' " order by gdate;"
if strDEBUG = "y" THEN Response.write "MySQL=" & MySQL & "<P>"
objRS.Open MySQL, objConn, 3, 3
Numrecs=objRS.RecordCount
If Numrecs < 1 Then
Response.write "</TABLE>"
Response.Write "No records for this Search"
Response.end
End IF
'''
objRS.MoveFirst
nCounts = 0
For i = 0 to 25 step 1
arrumps(i)= ""
Next
Do While Not objRS.EOF
FieldU = trim(objRS("FieldU"))
plateu = trim(objRS("plateu"))
strFound = "n"
For i = 0 to nCounts step 1
if FieldU = arrumps(I) THEN
strFound = "y"
if strDEBUG = "y" THEN Response.write _
"found: ump= " & FieldU & " I=" & I & "
"
END IF
Next
If strFound = "n" and FieldU <> "" THEN
arrumps (nCounts) = FieldU
nCounts = nCounts + 1
if strDEBUG = "y" THEN Response.write _
" New: FieldU= " & FieldU & " ncounts=" & ncounts & "
"
END IF
strFound = "n"
For i = 0 to nCounts step 1
if plateu = arrumps(I) and plateu <> "" THEN
strFound = "y"
if strDEBUG = "y" THEN Response.write _
"found: plateu= " & plateu & " I=" & I & "
"
END IF
Next
If strFound = "n" and plateu <> "" THEN
arrumps (nCounts) = plateu
nCounts = nCounts + 1
if strDEBUG = "y" THEN Response.write _
" New: plateu= " & plateu & " ncounts=" & ncounts & "
"
END IF
objRS.MoveNext
Loop
Dim nGames
'
Dim ObjRSumps
Set objRSumps = CreateObject("ADODB.Recordset")
objRSumps.Fields.Append "ump", adVarChar, 50
objRSumps.Open
For i = 0 to ncounts
objRSumps.Addnew
objRSumps("ump") = arrUmps(i)
''''''' Response.write arrUmps(i) & "
"
Next
objRSumps.Sort = "ump"
i = 0
objRSumps.MoveFirst
Do While not objRSumps.EOF
arrUmps(i) = objRSumps("ump")
i = i + 1
objRSumps.MoveNext
Loop
objRSumps.Close
'
For i = 1 to ncounts
nGames = 0
%>
<TABLE BORDER="1" Align="center" WIDTH="90%">
<TR>
<TH COLSPAN="9" class="UmpTHhead"><%=arrUmps(i)%></TH>
</TR>
<TR>
<TH>Solo ?</TH>
<TH>P/b</TH>
<TH>Field</TH>
<TH>Date</TH>
<TH>Time</TH>
<TH>Scorer</TH>
<TH>Home</TH>
<TH>Away</TH>
<TH>Other Ump</TH>
</TR>
<%
'''' objRS.Sort = "Plateu, gdate DESC"
objRS.MoveFirst
Dim strOtherUmp
Do While not objRS.EOF
if arrUmps(i) = objRS("Plateu") or arrUmps(i) = objRS("Fieldu") THEN
strSOLO = ""
nGames=nGames+1
IF trim(objRS("FieldU")& " " ) = "" THEN
strSOLO = "Y-1.5"
nGames=nGames+0.5
END IF
strOtherUmp = "b-" & objRS("Fieldu")
strPB = "P"
IF arrUmps(i) = ObjRS("Fieldu") THEN
strOtherUmp = "P-" & objRS("Plateu")
strPB = "b"
END IF
%>
<TR>
<TD><%=strSOLO%></td>
<TD class="tdcenter"><%=strPB%></TD>
<TD class="tdcenter"><%=objRS("fld")%></TD>
<TD class="tdcenter"><%=objRS("gdate")%></td>
<TD class="tdcenter"><%=objRS("gtime")%></TD>
<TD><%=objRS("scorer")%></td>
<TD><%=objRS("home")%></td>
<TD><%=objRS("away")%></td>
<TD><%=strOtherUmp%></td>
</TR>
<%
END IF
objRS.MoveNext
Loop
Response.Write "<TR><TD>Games: " & nGames & "</TD></TR>"
Response.write "</TABLE>"
Next
'''objRS.Sort = "League ASC , Wins DESC, Loss ASC"
%>
<!-- #INCLUDE FILE = "inccaslmenu1.asp" -->
</BODY>
</HTML>
Thanks,
Matthew
matthew@kleinosky.com
converting an ASP program to ASP.NET.
I want to use it to learn the migration.
The site is one I do for free for Americans playing softball in Egypt.
I have written tons of ASP code processing access databases and want to try it with ASP.NET
I don't know how to do the looping in .NET to accomplish the 2 passes throught the database - it reads a list of 'umpires' of the games - they can be either PLATE of FIELD UMPIRE.
Then, for EACH UMPIRE, it goes through database again, printing a report of each game they ump'd.
I can send a check or gifts from Egypt as payment. Please advise (low cost) bid/estimate or just do it.
you can see it in action at http://caslcairo.com/caslumps2003s.asp
the code follows:
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!-- #INCLUDE FILE = "adovbs.asp" -->
<%
Const strTABLENAME = "casl2003s"
Const strMAPPATH = "../../database/casl2003s1"
Const strTITLE = "CASL Spring 2003 "
Const strDEBUG = "n"
%>
<HTML><HEAD><TITLE><%=strTitle%> Umpires</TITLE>
<link rel="stylesheet" href="caslstyle1.css" TYPE = "text/css">
</HEAD>
<BODY>
<!-- #INCLUDE FILE = "inccasltop1.asp" -->
<!-- #INCLUDE FILE = "inccaslmenu1.asp" -->
<H1><%=strTitle%> Umpires</H1>
Please note this report does not include "Shadow Umpires"<HR>
<%
Dim FieldU, plateu, gametime, gdate, fld, NUMRECS, strNeedAnd
Dim league, home, away, scorer, i, strFound
Dim arrUmps (25), strPB
Dim nCounts, strSOLO
Dim objConn, DSNTemp, objRS, MySQL
Set objConn = Server.CreateObject("ADODB.Connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & Server.MapPath(strMAPPATH)
'''''''''response.write DSNTEMP
objConn.Open DSNtemp
Set objRS = Server.CreateObject("ADODB.Recordset")
MySQL= "Select * from " & strTABLENAME & _
" "
' " order by gdate;"
if strDEBUG = "y" THEN Response.write "MySQL=" & MySQL & "<P>"
objRS.Open MySQL, objConn, 3, 3
Numrecs=objRS.RecordCount
If Numrecs < 1 Then
Response.write "</TABLE>"
Response.Write "No records for this Search"
Response.end
End IF
'''
objRS.MoveFirst
nCounts = 0
For i = 0 to 25 step 1
arrumps(i)= ""
Next
Do While Not objRS.EOF
FieldU = trim(objRS("FieldU"))
plateu = trim(objRS("plateu"))
strFound = "n"
For i = 0 to nCounts step 1
if FieldU = arrumps(I) THEN
strFound = "y"
if strDEBUG = "y" THEN Response.write _
"found: ump= " & FieldU & " I=" & I & "
"
END IF
Next
If strFound = "n" and FieldU <> "" THEN
arrumps (nCounts) = FieldU
nCounts = nCounts + 1
if strDEBUG = "y" THEN Response.write _
" New: FieldU= " & FieldU & " ncounts=" & ncounts & "
"
END IF
strFound = "n"
For i = 0 to nCounts step 1
if plateu = arrumps(I) and plateu <> "" THEN
strFound = "y"
if strDEBUG = "y" THEN Response.write _
"found: plateu= " & plateu & " I=" & I & "
"
END IF
Next
If strFound = "n" and plateu <> "" THEN
arrumps (nCounts) = plateu
nCounts = nCounts + 1
if strDEBUG = "y" THEN Response.write _
" New: plateu= " & plateu & " ncounts=" & ncounts & "
"
END IF
objRS.MoveNext
Loop
Dim nGames
'
Dim ObjRSumps
Set objRSumps = CreateObject("ADODB.Recordset")
objRSumps.Fields.Append "ump", adVarChar, 50
objRSumps.Open
For i = 0 to ncounts
objRSumps.Addnew
objRSumps("ump") = arrUmps(i)
''''''' Response.write arrUmps(i) & "
"
Next
objRSumps.Sort = "ump"
i = 0
objRSumps.MoveFirst
Do While not objRSumps.EOF
arrUmps(i) = objRSumps("ump")
i = i + 1
objRSumps.MoveNext
Loop
objRSumps.Close
'
For i = 1 to ncounts
nGames = 0
%>
<TABLE BORDER="1" Align="center" WIDTH="90%">
<TR>
<TH COLSPAN="9" class="UmpTHhead"><%=arrUmps(i)%></TH>
</TR>
<TR>
<TH>Solo ?</TH>
<TH>P/b</TH>
<TH>Field</TH>
<TH>Date</TH>
<TH>Time</TH>
<TH>Scorer</TH>
<TH>Home</TH>
<TH>Away</TH>
<TH>Other Ump</TH>
</TR>
<%
'''' objRS.Sort = "Plateu, gdate DESC"
objRS.MoveFirst
Dim strOtherUmp
Do While not objRS.EOF
if arrUmps(i) = objRS("Plateu") or arrUmps(i) = objRS("Fieldu") THEN
strSOLO = ""
nGames=nGames+1
IF trim(objRS("FieldU")& " " ) = "" THEN
strSOLO = "Y-1.5"
nGames=nGames+0.5
END IF
strOtherUmp = "b-" & objRS("Fieldu")
strPB = "P"
IF arrUmps(i) = ObjRS("Fieldu") THEN
strOtherUmp = "P-" & objRS("Plateu")
strPB = "b"
END IF
%>
<TR>
<TD><%=strSOLO%></td>
<TD class="tdcenter"><%=strPB%></TD>
<TD class="tdcenter"><%=objRS("fld")%></TD>
<TD class="tdcenter"><%=objRS("gdate")%></td>
<TD class="tdcenter"><%=objRS("gtime")%></TD>
<TD><%=objRS("scorer")%></td>
<TD><%=objRS("home")%></td>
<TD><%=objRS("away")%></td>
<TD><%=strOtherUmp%></td>
</TR>
<%
END IF
objRS.MoveNext
Loop
Response.Write "<TR><TD>Games: " & nGames & "</TD></TR>"
Response.write "</TABLE>"
Next
'''objRS.Sort = "League ASC , Wins DESC, Loss ASC"
%>
<!-- #INCLUDE FILE = "inccaslmenu1.asp" -->
</BODY>
</HTML>
Thanks,
Matthew
matthew@kleinosky.com