in Search
ATTENTION: I've decided to put the upgrade on hold due to a compatibility issue of our server environment with the latest CS installer package. CS 2008 now requires SQL Server 2005 as the backend DB but our database server currenlty has SQL Server 2000 installed on it. I'll resume the upgrade once I figure out when Telligent is releasing a patch to the schema compatibility issue. For now, we will continue to use the old version of CS while waiting for the said patch. If you have any questions about this process, please don't hesitate to post them on our forums and I'll answer them as soon as I can. Thanks for your patience and support guys! I'll let you know as soon as this is resolved. - Keith Rull
Latest post 04-29-2008 3:59 AM by cruizer. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-29-2008 1:35 AM

    • jpgjuan
    • Top 75 Contributor
    • Joined on 08-29-2006
    • Posts 23
    • Points 440

    My counter on Classic ASP to ASP.NET 2.0

     The code below is my counter on Classic ASP.How can i convert it to ASP.NET 2.0?
    Please help.
    <%
    Dim rsSrcNc, strSrcNcCtrSQL, strSrcNC, strSrcNCCtr, strCPARNo, strDateYr, strDateMn, strSrcNCCtrUpdate

    strSrcNC = trim(Request.Form("txtCPARSrcNC"))
    strDateYr = Right(Year(Date()),2)
    strDateMn = Month(Date())
    If Len(strDateMn)=1 Then
    strDateMn = "0" & strDateMn
    End If

    Set rsSrcNc = Server.CreateObject("ADODB.Recordset")

    strSrcNcCtrSQL = "SELECT SRC_SrcNCID, SRC_Cntr FROM tblCPARSrcNC WHERE SRC_SrcNCID='" & strSrcNC & "'"
    rsSrcNc.open strSrcNCCtrSQL, cncpar

    If NOT rsSrcNC.EOF Then
    strSrcNCCtr = rsSrcNC.Fields("SRC_Cntr").Value
    Select Case Len(strSrcNcCtr)
    Case 1
    strSrcNcCtr = "00" & strSrcNcCtr
    Case 2
    strSrcNcCtr = "0" & strSrcNcCtr
    End Select

    strCPARNo = strSrcNC & strDateYr & strDateMn & "-" & strSrcNCCtr

    strSrcNCCtrUpdate = "UPDATE tblCPARSrcNC SET SRC_Cntr=" & rsSrcNC.Fields("SRC_Cntr").Value + 1
    strSrcNCCtrUpdate = strSrcNCCtrUpdate & " WHERE SRC_SrcNCID='" & strSrcNC & "'"
    rsSrcNc.Close

    End If

    %> 

    • Post Points: 5
  • 04-29-2008 3:59 AM In reply to

    • cruizer
    • Top 10 Contributor
    • Joined on 12-14-2005
    • Singapore
    • Posts 944
    • Points 22,590

    Re: My counter on Classic ASP to ASP.NET 2.0

    use ADO.NET and parameterised queries. your use of SQL string concatenation (using &) makes it vulnerable to SQL injection attack...

    http://devpinoy.org/blogs/cruizer
    Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
    • Post Points: 0
Page 1 of 1 (2 items)