bokaraton Posted February 19, 2004 Posted February 19, 2004 Does anyone know how to do this in vb.net with a data adapter or a dataset? I would like to setup a combobox for users to select "leaseNo"(a lease number) and that will find the record and automatically scroll to that record on the Lease Form. rs.MoveFirst rs.Find "[PROP_NO] = '" & LeaseNo & "'" rs.Find "[WELL_NO] = '" & WellNo & "'" rs.Find "[EFFDATE] = '" & CurrRecDate & "'" Quote
Moderators Robby Posted February 19, 2004 Moderators Posted February 19, 2004 Are you using ADO.NET? If so then use the Find Or FilterRow of the Dataview. Quote Visit...Bassic Software
bokaraton Posted February 19, 2004 Author Posted February 19, 2004 Thanks for your reply... I am using the form wizard which auto creates a connection, adapter and dataset object. In vb6 I dim cn and rs.recordset than use the find of the recordset but i dont know how to do that with the above objects. Quote
georgepatotk Posted March 2, 2004 Posted March 2, 2004 in vb 6.0 ado.recordsource _ = "SELECT * FROM tbl WHERE NAME = 'George' " ado.refresh in vb.net da.SelectCommand.CommandText _ = "SELECT * FROM tbl WHERE NAME = 'George' " ds.Clear() da.Fill(ds) Quote George C.K. Low
bokaraton Posted March 2, 2004 Author Posted March 2, 2004 cool...thanks for your reply also do you know if ado.net has some thing similar to vb6 recordset.absoluteposition? For example, if i had 100 records, in vb6 when i use rs.find it will tell me the absolute position of that record(lets say 55) then i can automatically move to that record position(55 of 100)... Quote
georgepatotk Posted March 2, 2004 Posted March 2, 2004 i am using data adapter and dataset. yes, i would like to know how to find a record and then select the searched record in datagrid using the above two components. for example, 100 rows in table. the algorithm found the record on row 55, then, the datagrid will be selected on row 55. Please Quote George C.K. Low
georgepatotk Posted March 2, 2004 Posted March 2, 2004 bokaraton, i don't know this and i am looking for his solution as well Quote George C.K. Low
Administrators PlausiblyDamp Posted March 2, 2004 Administrators Posted March 2, 2004 You may want to investigate the CurrencyManager class, that will allow you to use an absolute position within a bound datasource Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
georgepatotk Posted March 2, 2004 Posted March 2, 2004 I think this might not be the right ans. CurrenyManager is used to set or get the position of a particular row. My needs is on how to find a particular record based on some criteria. For example, based on Name Field. I want to search for record of "George" and "George" is in row 98. so, my program will search for"George" and automatically set "Selected" to row 98. Hope that you got my idea. Thanks in advance. Quote George C.K. Low
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.