Click here to Skip to main content
15,914,327 members
Home / Discussions / C#
   

C#

 
AnswerRe: hi all Pin
Rob Philpott18-Oct-05 1:10
Rob Philpott18-Oct-05 1:10 
QuestionMerging cells Pin
servik18-Oct-05 0:32
servik18-Oct-05 0:32 
QuestionNUMERIC DataGridViewColumn Pin
Greeky18-Oct-05 0:01
Greeky18-Oct-05 0:01 
AnswerRe: NUMERIC DataGridViewColumn Pin
Robert Rohde18-Oct-05 6:00
Robert Rohde18-Oct-05 6:00 
Questioniterating ResourceManager Pin
chettu17-Oct-05 23:51
chettu17-Oct-05 23:51 
QuestionAdd a toolbar in the windows deskbar... Pin
seup17-Oct-05 23:38
seup17-Oct-05 23:38 
AnswerRe: Add a toolbar in the windows deskbar... Pin
seup19-Oct-05 6:39
seup19-Oct-05 6:39 
QuestionODBC Dataadapter - Error HY007 on update! Pin
Patrick Klug17-Oct-05 22:33
Patrick Klug17-Oct-05 22:33 
C# .NET 1.1

I am using a ADO.NET Dataset containing of 2 tables... The tables are in a master(Table1)->detail(Table2) relationship and I use 2 Odbc Dataadapters (daTable1 and daTable2) to fill and update the tables...

--
MyDataSet dataSet = new MyDataSet ();


daTable1.Fill(dataSet);

daTable2.Fill(dataSet);
--

This works as expected and I use the dataset to change/insert some data.

Now I am trying to update the database with the following code:

--
if (dataSet.Table2.GetChanges(DataRowState.Deleted)!=null)

{
daTable2.Update(dataSet.Table2.GetChanges(DataRowState.Deleted));
}

if (dataSet.Table1.GetChanges(DataRowState.Deleted)!=null)
{
daTable1.Update(dataSet.Table1.GetChanges(DataRowState.Deleted));
}


if (dataSet.Table1.GetChanges(DataRowState.Modified)!=null)
{
daTable1.Update(dataSet.Table1.GetChanges(DataRowState.Modified));
}

if (dataSet.Table2.GetChanges(DataRowState.Modified)!=null)
{
daTable2.Update(dataSet.Table2.GetChanges(DataRowState.Modified));
}


if (dataSet.Table1.GetChanges(DataRowState.Added)!=null)
{
daTable1.Update(dataSet.Table1.GetChanges(DataRowState.Added));
}

if (dataSet.Table2.GetChanges(DataRowState.Added)!=null)
{
daTable2.Update(dataSet.Table2.GetChanges(DataRowState.Added));
}
--
I could do the same with

daTable1.Update(dataSet.Table1)
daTable2.Update(dataSet.Table2)

but I don't want to rely on cascading updates / deletes...

Anyway when both tables are effected I get the following OdbcException when calling the second Update method:

OdbcException ( ERROR [HY007] [Microsoft][ODBC SQL Server Driver]Associated statement is not prepared)

---

I really don't know why this happens and I couldn't find any information on the net.

I would really appreciate any help!

Thanks in advance
Pakl
AnswerRe: ODBC Dataadapter - Error HY007 on update! Pin
Gavin Jeffrey18-Oct-05 3:56
Gavin Jeffrey18-Oct-05 3:56 
GeneralRe: ODBC Dataadapter - Error HY007 on update! Pin
Patrick Klug18-Oct-05 6:00
Patrick Klug18-Oct-05 6:00 
QuestionWindows crash (BSOD) when compiling in VS.NET Pin
dorwin17-Oct-05 22:23
dorwin17-Oct-05 22:23 
AnswerRe: Windows crash (BSOD) when compiling in VS.NET Pin
leppie18-Oct-05 5:15
leppie18-Oct-05 5:15 
QuestionRegarding the ZedGraph Chart control that was posted by our friend JChampion Pin
sukanyavarma17-Oct-05 21:28
sukanyavarma17-Oct-05 21:28 
Questiontooltip on listbox Pin
Mridang Agarwalla17-Oct-05 21:12
Mridang Agarwalla17-Oct-05 21:12 
AnswerRe: tooltip on listbox Pin
Wjousts18-Oct-05 3:44
Wjousts18-Oct-05 3:44 
Questioncall a form and return the result Pin
Mridang Agarwalla17-Oct-05 21:05
Mridang Agarwalla17-Oct-05 21:05 
AnswerRe: call a form and return the result Pin
S. Senthil Kumar18-Oct-05 0:33
S. Senthil Kumar18-Oct-05 0:33 
AnswerRe: call a form and return the result Pin
Rob Philpott18-Oct-05 0:48
Rob Philpott18-Oct-05 0:48 
Questionstop a process on remote computer Pin
Prashant Gadhave17-Oct-05 20:27
Prashant Gadhave17-Oct-05 20:27 
Questionhelp:C# application and Databases Pin
jith - iii17-Oct-05 19:42
jith - iii17-Oct-05 19:42 
AnswerRe: help:C# application and Databases Pin
Guffa17-Oct-05 21:14
Guffa17-Oct-05 21:14 
GeneralRe: help:C# application and Databases Pin
jith - iii17-Oct-05 22:28
jith - iii17-Oct-05 22:28 
GeneralRe: help:C# application and Databases Pin
Guffa18-Oct-05 0:20
Guffa18-Oct-05 0:20 
GeneralRe: help:C# application and Databases Pin
jith - iii18-Oct-05 0:35
jith - iii18-Oct-05 0:35 
AnswerRe: help:C# application and Databases Pin
André Ziegler18-Oct-05 7:43
André Ziegler18-Oct-05 7:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.