Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 28th, 2006, 10:11 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old January 9th, 2007, 01:30 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might want to post this in one of the .NET forums, rather than the VB 6 forum.

Woody Z
http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter Expression In Datatables Anil_ARB C# 0 July 31st, 2008 02:49 AM
Viewing Datatables in Dataview Angus 2007 Visual Basic 2005 Basics 1 July 6th, 2007 07:08 AM
How to merge two datatables????????? avats ADO.NET 3 March 21st, 2006 08:40 AM
DataTables and Web Services BSkelding VB.NET 2002/2003 Basics 0 December 22nd, 2004 06:12 PM
2 x DataTables and Datagrid Vince ADO.NET 0 September 22nd, 2003 08:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.