share dataset between 2 form?

Joined
Jun 4, 2008
Messages
12
Programming Experience
Beginner
hai.. i have a question :confused: .... i have two form.. and one data set.. how can i share the two form with using the data set..what i mean is i can save and view the table but the problem is when i delete... the table adapter cannot communicate between form 1 and form2 and cannot update.. It will become duplication of the table inside the dataset between form 1 and form 2.
i already google it and there's only method how to delete between parent and child. Is it the method i doing is wrong..or the code i doing is wrong.. plz help me...reply me asap


code

Me.TableAdapterManager.UpdateAll(Me.PublicinfoDataSet)
 
I dont see how it's any different to passing anything else (such as string) between 2 forms, what are you having the problem with?
 
what i mean that i can't delete from form2 and then update the only one dataset that i used for form 1 and form 2. the dataset in form 2 can't be update and load to form 1..i have the problem with tableadapter.Update all.
duplication and redundancy of database.

And one more things , how can i restore or reset the table adapter sql queries.. for the delete and update queries.
normally when i drag from dataset(details or data grid) ..the binding navigator will automatic generate the all the button for me..but right now i cannot save and delete. "No sql command was found to delete row"...etc. how can i reset the sql quires back to normal..i already check check inside table adapter..get fill ..configure but there is no command for delete and update..i have already try to open an old project and try to used the same procedure but still can't work.
i thing i screw something up when i try to change the sql queries..i even try to reinstall visual studio again in order to get the back the sql quiries but it doesn't work.

plz help me..just a newbie..still need more to learn :confused:
 
tables that have no primary key cannot, by their very nature, have UPDATE or DELETE queries made for them because the Visual Studio cannot work out how to uniquely identify exactly one row
 
herm..by right it should be like that.the standard generate code..but right now the delete and update command is none.. is there anyway to reset that the command back..every time i create a new dataset..the command inside table adapter for delete and save command is not there?:eek: don't know what to do
 
tables that have no primary key cannot, by their very nature, have UPDATE or DELETE queries made for them because the Visual Studio cannot work out how to uniquely identify exactly one row
 
how about the dataset..is there a way to refresh the form and dataset in form 1 when i delete in form 2 without closing the form 2. .(i'm using the same dataset in form1 and form2) sorry if it sound kindda stupid question? :eek:
 
Last edited:
rem...right now...i already try everything but the dataset in form 1 in not updated if i did not close form2. i fill the data in form 1 and save it so that i it will be share in both form.(i can see the data in form 2)

but when i delete from form 2.. and i did not close form2 / create a button to link back to form 1..the dataset in form 1 is not being updated.

what i have to do right now is to close form 2 and open again the program. And then dataset in form 1 and 2 are being updated.

is the method i doing is wrong? ---->sorry , just a newbie...or is there any way to close form 1 only when i click button to enter form 2.


i hope i explain it very clearly... hehe ..still need more to learn from u guys :)....hope u guys have an idea...thanks
 
Your post doesnt make sense to me, sorry.. It's too confused and there is no logical flow to it. Please assume that I'm a computer and give me a set of statements that accurately describes what your current set up is and what your goals are. Here is an example:

I have a main form, called MainForm
MainForm has a DataSet1, XYZBindingsource and XYZDataGridView
I have another form, ChildForm
ChildForm has ABCBindingSource, and ABCDataGridView
ChildForm has a constructor that takes a DataSet as a parameter
In the constructor I set the ABCBindingSource.DataSOurce = to the passed-in dataset
(and so on...)

Can you see how this is so much clearer than the garbled post you wrote? I can actually make sense of this because it is like a VB.NET program
 

Latest posts

Back
Top