473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Advice needed for finding matches

I need to perform a validation process from my forms and am not sure how to
accomplish this. I'm new to vb.net. Here is my scenario. In my database I
have a table, we'll call it Table A. In this table there are two fields,
field 1 and field 2. The combination of these two fields will form my unique
index. On my form I have two text boxes. When the user enters data into the
boxes, I need a way to compare the concatenation on the two text box values
to the fields in my table. I thought of possible using a DataSet and
DataTable, possibly looping through it, such as you would a Recordset.
Again I'm new and would appreciate any advice to get pointed in the right
direction.

Kind of what I had in mind, but am open for suggestions.

Ex. How can this be done in vb.net

With rs

Str = rs!field1 &,& rs!field2

If str = text1 &,& text2 then

Match found

End if

.movenxt

end with

Thanks.

Fred
Nov 20 '05 #1
4 937
"Freddie" <ki****@excite.com> schrieb
I need to perform a validation process from my forms and am not sure
how to accomplish this. I'm new to vb.net. Here is my scenario. In my
database I have a table, we'll call it Table A. In this table there
are two fields, field 1 and field 2. The combination of these two
fields will form my unique index. On my form I have two text boxes.
When the user enters data into the boxes, I need a way to compare the
concatenation on the two text box values to the fields in my table. I
thought of possible using a DataSet and DataTable, possibly looping
through it, such as you would a Recordset. Again I'm new and would
appreciate any advice to get pointed in the right direction.


Assuming the fields have been set as the primary key:
DataTable1.Rows.Find(New object(){Value1, value2)

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Niether field is a primary key, only a combination of the two fields make up
the uunique index.

Thanks,

Fred
"Armin Zingler" <az*******@freenet.de> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
"Freddie" <ki****@excite.com> schrieb
I need to perform a validation process from my forms and am not sure
how to accomplish this. I'm new to vb.net. Here is my scenario. In my
database I have a table, we'll call it Table A. In this table there
are two fields, field 1 and field 2. The combination of these two
fields will form my unique index. On my form I have two text boxes.
When the user enters data into the boxes, I need a way to compare the
concatenation on the two text box values to the fields in my table. I
thought of possible using a DataSet and DataTable, possibly looping
through it, such as you would a Recordset. Again I'm new and would
appreciate any advice to get pointed in the right direction.


Assuming the fields have been set as the primary key:
DataTable1.Rows.Find(New object(){Value1, value2)

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
"Freddie" <ki****@excite.com> schrieb
Niether field is a primary key, only a combination of the two fields
make up the uunique index.

Yes, that's what I meant.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
Cor
Hi Freddie,

You can use something as
\\\
dim myselectedrows as datarow() = ds.tables(0).select("Your
Datacolumn.Expression")
////
This gives back a array of datarows which you can do in a for each loop

or exactly what you ask
dim i as integer
for i = 0 to ds.tables(0).rows.count-1
if ds.tables(0).rows(i).item("Item1")=Item1 AndAlso
................
next
///
And for the movenext
\\\
for i = i to ds.tables(0).rows.count-1
etc.
///
I hope this helps,

Cor

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nick Malik | last post by:
reposting to a wider audience "Nick Malik" <nickmalik@hotmail.nospam.com> wrote in message news:WYONc.203854$XM6.119642@attbi_s53... > My turn to ask a question > > I am working on a plug-in...
4
by: Nick Malik | last post by:
My turn to ask a question I am working on a plug-in for Sharepoint that will allow a developer to add workflow rules. One of the rules will inform the adapter that it should load a DLL that the...
9
by: Laban | last post by:
Hi, I find myself using static methods more than I probably should, so I am looking for some advice on a better approach. For example, I am writing an app that involves quite a bit of database...
4
by: Nick Malik | last post by:
reposting to a wider audience "Nick Malik" <nickmalik@hotmail.nospam.com> wrote in message news:WYONc.203854$XM6.119642@attbi_s53... > My turn to ask a question > > I am working on a plug-in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.