|
-
Feb 1st, 2003, 11:00 PM
#1
Thread Starter
New Member
Dataset and searching non primary key columns.
Hi Agian,
I have a a question and it has to do with searching a column that is not primary key in a MS Access DB.
Today this is all I know....I know its sad, but I'm working on it. 
------------------------------------------------------------------------------------
objDataSet.Clear()
objDA_bdg_Bank.FillSchema(objDataSet, SchemaType.Mapped, "bdg_Bank")
objDA_bdg_Bank.Fill(objDataSet, "bdg_Bank")
Dim objRow As DataRow
objRow = objDataSet.Tables("bdg_Bank").Rows.Find(cboBankName.Text)
------------------------------------------------------------------------------------
This table has the following columns:
bdg_BankId = (Primary Key)
bdg_BankName = cboBankName (Unique)
Unfortunatly VB doesn't allow me to search column bdg_BankName as it's not the Primary Key because I use .Find
So how can I search for an example bdg_BankName but return the value of bdg_Bank_Id
Doing this in SQL would look like this:
Select bdg_BankId
From bdg_Bank
Where bdg_BankName = "String"
Would be so much easier if one could use SQL statements to execute search criteria's.
Thank you for listening.
Claudio
-
Feb 1st, 2003, 11:50 PM
#2
You can get a set of filtered datarows by using the Select method:
VB Code:
Dim objRow() As DataRow = objDataSet.Tables("bdg_Bank").Rows.Select("FieldName='FieldValue'")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|