R
ruca
Hi,
I want to migrate an ASP aplication to ASP .NET, but it is being more
difficulty that what I think initial.
In my ASP aplication I have a recordset turn off (that's the name that I
call him). And you ask me, WHAT'S THAT?
Well...
I need to load to a dropdown control the name of people that are in a .TXT
file, and for that I simulate a recordset withouT DB connection. This is the
code of that recordset:
code:-----------------------------------------------------------------------
-------
'Initialize
Set rs = Server.CreateObject("ADODB.Recordset")
rs.LockType = 3
rs.CursorLocation = 3
rs.Fields.Append "Cd", 8, 50, 4
rs.Fields.Append "Name", 8, 50, 4
rs.Fields.Append "Pwd", 8, 50, 4
rs.Open
'Fill the RecordSet
'I pass the file to the function
Sub ProcessUser(txtLine)
On Error Resume Next
p1 = instr(txtLine,",")
if p1>0 then
Cd=left(txtLine,p1-1)
LineAux = mid(txtLine,p1+1)
pos = instr(LineAux,",")
NameFunc = left(LineAux,pos-1)
Key = mid(LineAux, pos+1)
if rs.EOF then
rs.AddNew
rs("Cd")=Cd
rs("Name")=NameFunc
rs("Pws")=Key
rs.Update
end if
end if
End Sub
'Fill dropdown
<%
function fill_drop()
On Error Resume Next
ler_users
%>
<select name="func" size=1>
<option selected>-- escolha -- </option>
<%
rs.MoveFirst
While Not rs.EOF
%>
<option
value="<%=rs.Fields("CdRcs")%>"><%=rs.Fields("NmAbreviado")%></option>
<!--<option
value="<%=rs.Fields("CdRcs")%>"><%=rs.Fields("NmAbreviado")%></option>-->
<%rs.MoveNext
WEnd
rs.Close
'Set Conn = nothing
%>
</select>
<%
end function
----------------------------------------------------------------------------
--
The thing is that I'm new on ASP .NET and I can't do this because the
methods are different. So I need your help to give me a good solution and
sugest what's better and say what's the "substitute" for ADODB.Recordset
__________________
Hope it will help you (if I try to help you)
Thanks (if you try to help me),
ruca
I want to migrate an ASP aplication to ASP .NET, but it is being more
difficulty that what I think initial.
In my ASP aplication I have a recordset turn off (that's the name that I
call him). And you ask me, WHAT'S THAT?
Well...
I need to load to a dropdown control the name of people that are in a .TXT
file, and for that I simulate a recordset withouT DB connection. This is the
code of that recordset:
code:-----------------------------------------------------------------------
-------
'Initialize
Set rs = Server.CreateObject("ADODB.Recordset")
rs.LockType = 3
rs.CursorLocation = 3
rs.Fields.Append "Cd", 8, 50, 4
rs.Fields.Append "Name", 8, 50, 4
rs.Fields.Append "Pwd", 8, 50, 4
rs.Open
'Fill the RecordSet
'I pass the file to the function
Sub ProcessUser(txtLine)
On Error Resume Next
p1 = instr(txtLine,",")
if p1>0 then
Cd=left(txtLine,p1-1)
LineAux = mid(txtLine,p1+1)
pos = instr(LineAux,",")
NameFunc = left(LineAux,pos-1)
Key = mid(LineAux, pos+1)
if rs.EOF then
rs.AddNew
rs("Cd")=Cd
rs("Name")=NameFunc
rs("Pws")=Key
rs.Update
end if
end if
End Sub
'Fill dropdown
<%
function fill_drop()
On Error Resume Next
ler_users
%>
<select name="func" size=1>
<option selected>-- escolha -- </option>
<%
rs.MoveFirst
While Not rs.EOF
%>
<option
value="<%=rs.Fields("CdRcs")%>"><%=rs.Fields("NmAbreviado")%></option>
<!--<option
value="<%=rs.Fields("CdRcs")%>"><%=rs.Fields("NmAbreviado")%></option>-->
<%rs.MoveNext
WEnd
rs.Close
'Set Conn = nothing
%>
</select>
<%
end function
----------------------------------------------------------------------------
--
The thing is that I'm new on ASP .NET and I can't do this because the
methods are different. So I need your help to give me a good solution and
sugest what's better and say what's the "substitute" for ADODB.Recordset
__________________
Hope it will help you (if I try to help you)
Thanks (if you try to help me),
ruca