Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 09, 2012 12:43 AM by Decker Dong - MSFT
Dec 07, 2012 07:59 PM|LINK
I have this custom BLL:
public class BLL
public DataTable select()
DataTable D = new DataTable();
object Row = new object[NumberofColumns];
public bool Update(List of parameters)
Select part is not a problem, I return my custom table. But how can I define list of parameters for update method while number of columns is dynamic?
Dec 08, 2012 09:09 AM|LINK
As far as I see, since your DataTable is memory-based. And your dynamic DataTable can be from different kind of table in your database. So you have to reject the ObjectDataSource (because any DataSource can be applied to a fixed structure db). You have to
use SqlDataAdapter.Fill method for a DataTable, and then use SqlCommandBuilder to build automatically CRUD and if there's anything changed for any row inside the DataRow, just directly call adapter.Update(DataTable instance);
Dec 08, 2012 07:00 PM|LINK
I must put some time to explore it in depth, I'm not sure if I got your meaning or not, Does
SqlDataAdapter manipulate my in memory table? There is no SQL Server backside. And, does SqlDataAdapter connect to data view controls like Gridview?
Byh the way I used DetailsView_ItemUpdating method of detailsview and it works for my case for updating my im memory table. I don't know if there may be a more standard way?
Dec 09, 2012 12:43 AM|LINK
Does SqlDataAdapter manipulate my in memory table? There is no SQL Server backside. And, does SqlDataAdapter connect to data view controls like Gridview?
No. SQLDataAdapter will only fetch data contents from db's table and fill into a DataTable.
If you only wanna use a memory-based DataTable, just please define a static DataTable or a DataTable that is stored in a ViewState and you can always use that.
I don't know if there may be a more standard way?
For a memory-based DataTable, that's enough;)