Read DataSet

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 = objFicheiro_OpenTextFile(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:

asp:DropDownList id="cxFunc" runat="server" DataSource="<% # ler_users() %>"
DataTextField="NmAbreviado" DataMember="CdRcs" DataValueField="CdRcs"


Can you help me???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top