R
ruca
Sorry I'm new on this,
I have this in code:
I'm reading data from a .TXT file
----------------------------------------------------
Sub ProcessUser(txtLine)
On Error Resume Next
Dim p1, pos as Integer
Dim Cd, LineAux, NomeFunc, Pass, strLabel as String
Dim row as DataRow
p1 = instr(txtLine,",")
if p1>0 then
Cd=left(txtLine,p1-1)
LineAux = mid(txtLine,p1+1)
pos = instr(LineAux,",")
NomeFunc = left(LineAux,pos-1)
Pass = mid(LineAux, pos+1)
'Response.Write CdFunc & "-" & NomeFunc & "-" & Pass
strLabel="CdRcs = "& "'" & Cd & "'"
response.write(Cd)
row = table.NewRow()
row("CdRcs") = Cd
row("NmAbreviado") = NomeFunc
row("Key") = Pass
table.Rows.Add(row)
end if
End Sub
Function ler_users() As DataTable
On Error Resume Next
Dim objFicheiro, LerUser as Object
objFicheiro = CreateObject("Scripting.fileSystemObject")
LerUser = objFicheirpenTextFile(Server.MapPath("func.txt"))
While not LerUser.AtEndOfStream
ProcessUser (LerUser.ReadLine)
End While
LerUser.Close
LerUser = nothing
return table
End Function
---------------------------------------------
I want to put in a dropdownlist the name of people but I can't. For that I
have this:
aspropDownList id="cxFunc" runat="server" DataSource="<% # ler_users() %>"
DataTextField="NmAbreviado" DataMember="CdRcs" DataValueField="CdRcs"
Can you help me???
I have this in code:
I'm reading data from a .TXT file
----------------------------------------------------
Sub ProcessUser(txtLine)
On Error Resume Next
Dim p1, pos as Integer
Dim Cd, LineAux, NomeFunc, Pass, strLabel as String
Dim row as DataRow
p1 = instr(txtLine,",")
if p1>0 then
Cd=left(txtLine,p1-1)
LineAux = mid(txtLine,p1+1)
pos = instr(LineAux,",")
NomeFunc = left(LineAux,pos-1)
Pass = mid(LineAux, pos+1)
'Response.Write CdFunc & "-" & NomeFunc & "-" & Pass
strLabel="CdRcs = "& "'" & Cd & "'"
response.write(Cd)
row = table.NewRow()
row("CdRcs") = Cd
row("NmAbreviado") = NomeFunc
row("Key") = Pass
table.Rows.Add(row)
end if
End Sub
Function ler_users() As DataTable
On Error Resume Next
Dim objFicheiro, LerUser as Object
objFicheiro = CreateObject("Scripting.fileSystemObject")
LerUser = objFicheirpenTextFile(Server.MapPath("func.txt"))
While not LerUser.AtEndOfStream
ProcessUser (LerUser.ReadLine)
End While
LerUser.Close
LerUser = nothing
return table
End Function
---------------------------------------------
I want to put in a dropdownlist the name of people but I can't. For that I
have this:
aspropDownList id="cxFunc" runat="server" DataSource="<% # ler_users() %>"
DataTextField="NmAbreviado" DataMember="CdRcs" DataValueField="CdRcs"
Can you help me???