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
%>