Z
Ziemowit
Hi all
I have problem with strongly-typed dataset.
I have two datasets generated by VisualStudio tools from database. DataSetA
consist of three tables, DataSetB of one.
Now I have to update both of them in one transaction.
If I try:
SQlConnection conn = new SqlConnection(connString);
conn.Open();
SqlTransaction trans = conn.BeginTransaction();
try {
//here is update DataSetA
//something to do
//update DataSetB
trans.Commit();
}
catch
{
trans.Rollback();
}
finally
{
conn.Close();
}
I have message tat command need transaction. I'm using namespace with
DataAdapters that is generated by VisualStudio and there is no way to
specify transaction. What I can do to solve this?
Thanks for any help
Ziemowit S.
I have problem with strongly-typed dataset.
I have two datasets generated by VisualStudio tools from database. DataSetA
consist of three tables, DataSetB of one.
Now I have to update both of them in one transaction.
If I try:
SQlConnection conn = new SqlConnection(connString);
conn.Open();
SqlTransaction trans = conn.BeginTransaction();
try {
//here is update DataSetA
//something to do
//update DataSetB
trans.Commit();
}
catch
{
trans.Rollback();
}
finally
{
conn.Close();
}
I have message tat command need transaction. I'm using namespace with
DataAdapters that is generated by VisualStudio and there is no way to
specify transaction. What I can do to solve this?
Thanks for any help
Ziemowit S.