Need Help With DataTables
I'm creating a Search Page As Follows. First off, I'm not allowed to use any databases for this tool. As a result this is my approach.
I have a text file which am reading all data from in this format:
Speech Title, Speech Speaker, Speech Date, Speech Subject.
That part is working fine. As well as creating a Datatable first of all for the "Speaker" using the code below and storing that entire datatable object in a Session:
Dim objDT As System.Data.DataTable
Dim objDR As System.Data.DataRow
objDT = New System.Data.DataTable("Speaker_Table")
objDT.Columns.Add("ID", GetType(Integer))
objDT.Columns("ID").AutoIncrement = True
objDT.Columns("ID").AutoIncrementSeed = 1
objDT.Columns("ID").Unique = true
objDT.PrimaryKey = New DataColumn(){objDT.Columns("ID")}
objDT.Columns.Add("LastName", GetType(String))
objDT.Columns.Add("FirstName", GetType(String))
Session("objDT") = objDT
I can display the entite "Speaker_Table" no problem in the browser.
My problem is how do I display a single record, for example if I pass a string like LastName from the search form. I've tried to use Select("LastName = 'mylastname'") and it's not working. If I try to use Select("ID = 3") it's working fine. But then I cannot really use that because i'd have to know it in advance.
Please help me as I am new to dotnet stuff.
Thanks A lot
PTM
ptm
|