Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Thursday, March 29, 2012

correct way to update a db from a dataset using sqlxml

I have a dataset populated correctly from a mapping XSD (which maps a many to
many rel. from the db).
but on using the SQLXMLDataAdapter.update() method gives me Invalid column
errors. Even with a MS produced northwind schema. Is there a standard code
example of how to do an update like this?
thankyou,
Gordon Doherty
Hi Gordy:
Here is a kb article which has several links to address what you're looking
for: http://support.microsoft.com/default...b;en-us;313483
Regards,
John Cross
This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, March 22, 2012

copying SQLDataSource Data into DataSet

is there a way to copy a SqlDataSource Data into a dataset?http://forums.asp.net/thread/1278086.aspx|||

alt solution...

string connectionString = "...Northwind Connection String...";
string selectSql = "SELECT [CategoryID], [CategoryName] FROM [Categories]";

DataSourceSelectArguments args = new DataSourceSelectArguments();

SqlDataSource dataSource = new SqlDataSource(connectionString, selectSql);
DataView view = (DataView)dataSource.Select(args);

DataTable table = view.ToTable();

found here...

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=228386&SiteID=1

|||
DataView dv=(DataView)(SqlDataSource1.Select(DataSourceSelectArguments.Empty));DataSet newDS =new DataSet(); DataTable dt = dv.Table.Clone();foreach (DataRowView drvin dv)dt.ImportRow(drv.Row);newDS.Tables.Add(dt);
|||Thank You all. Somehow I was not able to find a solutions. All of these solutions worked great.