-
sqladapter
Hi gurus
I have a select statement, this select statement comes back on a slqadapter, would l would like to do is like
textbox1.text=sqladapter.(columane1)
textbox2.text=sqladapter.(columane2)
and so forth instead of filling a datagrid.
can you point me to the right direction
Thanks a bunch
-
Re: sqladapter
Im no Expert on Databases But a DataReader should be more suited to your needs depending on your table layout. Or you can use your sqladapter and fill a datatable and loop through that filling the textboxes
-
Re: sqladapter
What's the point? If it's something like the BindingNavigator it only exists after the .net framework 2?
CodeProject Sample
-
Re: sqladapter
Do you mean a SQLDataAdapter, or is this something different? Are you trying to bind data to the textboxes, or just populate them?
-
Re: sqladapter
sorry gurus
I meant to say sqldataadapter, yes I would like use aside from filling a datagrid, how do I go and pull the result on sqldataadapter and fill multiple textboxes.
Thanks a bunch gurus
-
Re: sqladapter
The dataadapter fills a datatable. You would then use the datatable to fill the textboxes. The reason for having the datatable is so that you have a copy of the information from the database in memory. The datatable doesn't even have to match the structure of the underlying database. If those reasons don't apply, then you probably don't need a datatable, in which case you probably don't want to use a dataadapter at all.
A datareader would be better if you only wanted to show one row, or only wanted to go forward through a set of rows. Otherwise, if you want to go forwards and back through the rows, or want to make changes to the data, you would probably be better off using a dataadapter, but filling a datatable explicitly, then using that datatable for populating the textboxes. I used the term 'explicitly' because your original post suggests that you have used dataadapters to fill datatables bound to datagridviews without really recognizing the existence of the datatable.
-
Re: sqladapter
Thanks a bunch S. I will look into the datable.
Thanks again