hemenkap
Active member
hi friends,
i have been programming with dataset since 2 weeks, well i do know that dataset does not support a cursor like the recordset so we cannot get the current position in the recordset.
however i have created an user control for handling the navigation of the dataset as well as to handle saving of form data plus othe functions also.
in that control i am passing the dataset as well as the table name in the dataset to navigate and the navigation works just fine.
i am even able to retrive my current position in the dataset using my control ( however this works only if you are navigating thru the database using the navigation buttons provided).
now waht i am trying to do is that when the user enters some data in a field on the form. on each key press event i check if the
textbox.TEXT matches with any of the rows in a particular column in the database.
if NO MATCH means that the user may be entering a new record and form enters INSERT MODE, if there is a match the all the remaing textboxes are filled to diaplay the data for that recoed and the form enters EDIT MODE.
however when this happens what i want to do is that i want to update my navigation control so that it displays my current position in the dataset..
i am locatin the current row using the
dataset.tables.Select method as i am not searchin on primary key.
my navigation control uses
me.parentform.bindingcontext(dataset.tables).posotion to locate my current position in the dataset....
if onyl you can tell me that once i do a Select/Find using the textbox.Text string AND if i hit a row ( it will always return one row only as the string is unique ) how to know the position of this row. As both these method return a row/ or row collection. but i am not intrested much in the row returned. it is the position that is outmost important...
if any body can help it will be truly great
thanks.
Hemen
i have been programming with dataset since 2 weeks, well i do know that dataset does not support a cursor like the recordset so we cannot get the current position in the recordset.
however i have created an user control for handling the navigation of the dataset as well as to handle saving of form data plus othe functions also.
in that control i am passing the dataset as well as the table name in the dataset to navigate and the navigation works just fine.
i am even able to retrive my current position in the dataset using my control ( however this works only if you are navigating thru the database using the navigation buttons provided).
now waht i am trying to do is that when the user enters some data in a field on the form. on each key press event i check if the
textbox.TEXT matches with any of the rows in a particular column in the database.
if NO MATCH means that the user may be entering a new record and form enters INSERT MODE, if there is a match the all the remaing textboxes are filled to diaplay the data for that recoed and the form enters EDIT MODE.
however when this happens what i want to do is that i want to update my navigation control so that it displays my current position in the dataset..
i am locatin the current row using the
dataset.tables.Select method as i am not searchin on primary key.
my navigation control uses
me.parentform.bindingcontext(dataset.tables).posotion to locate my current position in the dataset....
if onyl you can tell me that once i do a Select/Find using the textbox.Text string AND if i hit a row ( it will always return one row only as the string is unique ) how to know the position of this row. As both these method return a row/ or row collection. but i am not intrested much in the row returned. it is the position that is outmost important...
if any body can help it will be truly great
thanks.
Hemen