Very strange problem!

Y

yonggangwang

Hi:my friends
I meet a very very strange problem;
I use untyped dataset, after I changed
the value of one row in the datatable,I see
the rowstate is modified,but after I call the update method of
datadapter,nothing hanppend.Here is my code:
daMasterRemote.Update(dsRemote.order_master);

dsLocal.Tables["order_master"].Rows[comboPadNo.SelectedIndex]["order_no_remo
te"]=(int)dsRemote.order_master[0].order_no;
string
s=dsLocal.Tables["order_master"].Rows[comboPadNo.SelectedIndex].RowState.ToS
tring();
daMaster.Update(dsLocal.Tables["order_master"]);
string
s1=dsLocal.Tables["order_master"].Rows[comboPadNo.SelectedIndex].RowState.To
String();
s="Modified",s1="UnChanged"
dsLocal is Access(untyped),dsRemote is Sql(typed);
Before I used typed dataset for Access, it has same problem,so I try to use
uptyped dataset two days ago,
It worked very well,but It stoped again yesterday,I don't konw why. Dose
anyone have a idea?
(I have already tried office2000 and officexp,same problem)
Thanks a lot!
Yonggang_Wang
 
V

Val Mazur

Hi,

I believe problem here is that you did not specify INSERT/UPDATE/DELETE
statements for your dataAdapetr using InsertCommand, UpdateCommand and
DeleteCommand respectively. In this case DataAdapter just does nothing. You
could do this defining your own action commands or you could use
CommandBuilder class to generate these commands based on your SELECT
statement. See next example how to use CommandBuilder. It use
SqlCommandBuilder as an example, but you could do it using
OledbCommandBulder same way

http://support.microsoft.com/default.aspx?scid=kb;en-us;308055
 
Y

yonggangwang

Thank you so much!
I have alreay created Insert/Update/Delete
command use dataAdapter wizard before, I used it in many forms, others
working very
well.One week ago ,I used strong-typed DataSet, sometimes it doesn't work, I
have not find the reason. So I changed the code , Now I use untyped dataSet,
But samething happend yesterday, I don't know why.Have you ever meet any
situation like mine before?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top