|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Another Dataset questionHi All,
I'm New to VS.net. Trying to figure out this new dataset thingy. Ok so I add a dataadapter with all the correct properties for a table. Then generate the dataset. Now open the dataset and drag another table from the server explorer, set up some relations there. Set up two grids, one a s a parent one as a chgild. Fill the dataset, run the form But my child grid never gets any records. I then added another datadapter for the child tabel, regenerated the dataset, resetup the relatiosn. Now it works Do I have to have a datadapter for each table that I am working with. If this is so, why allow the user to drag and drop a table onto the dataset. Covert your answers Thanks Robert Hi,
Show quoteHide quote "Robert Bravery" <m*@u.com> wrote in message Yes. That is if you want to store to and load from a DB.news:%23bhh7mAGGHA.2608@TK2MSFTNGP10.phx.gbl... > Hi All, > I'm New to VS.net. Trying to figure out this new dataset thingy. > Ok so I add a dataadapter with all the correct properties for a table. > Then > generate the dataset. Now open the dataset and drag another table from the > server explorer, set up some relations there. Set up two grids, one a s a > parent one as a chgild. Fill the dataset, run the form > But my child grid never gets any records. > > I then added another datadapter for the child tabel, regenerated the > dataset, resetup the relatiosn. Now it works > > Do I have to have a datadapter for each table that I am working with. >If this is so, why allow the user to drag and drop a table onto the There is a difference between a typed DataTable and a DataAdapter. A typed >dataset. > DataTable is 'configured' inside a DataSet schema, from there code is generated for the typed DataSet class and the typed DataTable classes, then the typed DataSet/DataTable's can be instantiated from code or with the Designer. A DataAdapter on the other hand is just a class like any other, it can't be configured inside a DataSet schema, it can only be instantiated and configured at runtime from code or from designer. Hence dragging a Table from Server Explorer into a Typed DataSet, doesn't create a DataAdapter, where would it need to create one ? on Form1, on Form2, in some code file ? No you need to create your own DataAdapter where you need it, you could create it with the Designer on a Form or within code (if you need the same on different forms). In 1.1 the DataAdapter (on a Form) can however be used to generate a typed DataSet. The simpliest steps for a master-child are to drag the two tables from Server Explorer onto the Form, this should create two DataAdapters, then right-click on the Form and choose "Generate DataSet", make sure both tables are checked and click ok. Then you could open the typed dataset in schema designer to check if there is a relation (and add one if there isn't). All this is one of the important changes in Net2.0, in Net2.0 there are TableAdapters, they are similar to DataAdapters except that now they are generated classes that are also configured inside the DataSet schema, just like typed DataTable's. HTH, Greetings Show quoteHide quote > Covert your answers > > Thanks > Robert > > > Hi Bart,
thanks for the explanation. So if I understand correctly. The same datasetcan be used on many different forms as long as there are the correct dataadapters on each form. Is this correct Thanks Robert Show quoteHide quote "Bart Mermuys" <bmermuys.nospam@hotmail.com> wrote in message news:e65ERPEGGHA.2652@tk2msftngp13.phx.gbl... > Hi, > > "Robert Bravery" <m*@u.com> wrote in message > news:%23bhh7mAGGHA.2608@TK2MSFTNGP10.phx.gbl... > > Hi All, > > I'm New to VS.net. Trying to figure out this new dataset thingy. > > Ok so I add a dataadapter with all the correct properties for a table. > > Then > > generate the dataset. Now open the dataset and drag another table from the > > server explorer, set up some relations there. Set up two grids, one a s a > > parent one as a chgild. Fill the dataset, run the form > > But my child grid never gets any records. > > > > I then added another datadapter for the child tabel, regenerated the > > dataset, resetup the relatiosn. Now it works > > > > Do I have to have a datadapter for each table that I am working with. > > Yes. That is if you want to store to and load from a DB. > > >If this is so, why allow the user to drag and drop a table onto the > >dataset. > > > > There is a difference between a typed DataTable and a DataAdapter. A typed > DataTable is 'configured' inside a DataSet schema, from there code is > generated for the typed DataSet class and the typed DataTable classes, then > the typed DataSet/DataTable's can be instantiated from code or with the > Designer. > > A DataAdapter on the other hand is just a class like any other, it can't be > configured inside a DataSet schema, it can only be instantiated and > configured at runtime from code or from designer. > > Hence dragging a Table from Server Explorer into a Typed DataSet, doesn't > create a DataAdapter, where would it need to create one ? on Form1, on > Form2, in some code file ? No you need to create your own DataAdapter > where you need it, you could create it with the Designer on a Form or within > code (if you need the same on different forms). > > In 1.1 the DataAdapter (on a Form) can however be used to generate a typed > DataSet. The simpliest steps for a master-child are to drag the two tables > from Server Explorer onto the Form, this should create two DataAdapters, > then right-click on the Form and choose "Generate DataSet", make sure both > tables are checked and click ok. Then you could open the typed dataset in > schema designer to check if there is a relation (and add one if there > isn't). > > All this is one of the important changes in Net2.0, in Net2.0 there are > TableAdapters, they are similar to DataAdapters except that now they are > generated classes that are also configured inside the DataSet schema, just > like typed DataTable's. > > > HTH, > Greetings > > > > Covert your answers > > > > Thanks > > Robert > > > > > > > > Hi,
"Robert Bravery" <m*@u.com> wrote in message To be more precise each Form can have an instance of the same typed DataSet, news:e3g9oVGGGHA.2040@TK2MSFTNGP14.phx.gbl... > Hi Bart, > thanks for the explanation. > So if I understand correctly. The same datasetcan be used on many > different > forms as long as there are the correct dataadapters on each form. Is this > correct yes. Keep in mind that each Form will have its own instance, so the data isn't shared between Forms this way. You can create as many instances of the typed DataSet as you want (whether this is in code or on Forms) . And yes, you'll need to have a correct DataAdapter on each Form. So if you have multiple Form's that need the same DataAdapter then you could consider doing the DataAdapter configuration from a code file, class or module and then use that instead of placing the same DataAdapter on multiple Forms. Greetings, HTH Show quoteHide quote > > Thanks > Robert > > "Bart Mermuys" <bmermuys.nospam@hotmail.com> wrote in message > news:e65ERPEGGHA.2652@tk2msftngp13.phx.gbl... >> Hi, >> >> "Robert Bravery" <m*@u.com> wrote in message >> news:%23bhh7mAGGHA.2608@TK2MSFTNGP10.phx.gbl... >> > Hi All, >> > I'm New to VS.net. Trying to figure out this new dataset thingy. >> > Ok so I add a dataadapter with all the correct properties for a table. >> > Then >> > generate the dataset. Now open the dataset and drag another table from > the >> > server explorer, set up some relations there. Set up two grids, one a s > a >> > parent one as a chgild. Fill the dataset, run the form >> > But my child grid never gets any records. >> > >> > I then added another datadapter for the child tabel, regenerated the >> > dataset, resetup the relatiosn. Now it works >> > >> > Do I have to have a datadapter for each table that I am working with. >> >> Yes. That is if you want to store to and load from a DB. >> >> >If this is so, why allow the user to drag and drop a table onto the >> >dataset. >> > >> >> There is a difference between a typed DataTable and a DataAdapter. A > typed >> DataTable is 'configured' inside a DataSet schema, from there code is >> generated for the typed DataSet class and the typed DataTable classes, > then >> the typed DataSet/DataTable's can be instantiated from code or with the >> Designer. >> >> A DataAdapter on the other hand is just a class like any other, it can't > be >> configured inside a DataSet schema, it can only be instantiated and >> configured at runtime from code or from designer. >> >> Hence dragging a Table from Server Explorer into a Typed DataSet, doesn't >> create a DataAdapter, where would it need to create one ? on Form1, on >> Form2, in some code file ? No you need to create your own DataAdapter >> where you need it, you could create it with the Designer on a Form or > within >> code (if you need the same on different forms). >> >> In 1.1 the DataAdapter (on a Form) can however be used to generate a >> typed >> DataSet. The simpliest steps for a master-child are to drag the two > tables >> from Server Explorer onto the Form, this should create two DataAdapters, >> then right-click on the Form and choose "Generate DataSet", make sure >> both >> tables are checked and click ok. Then you could open the typed dataset >> in >> schema designer to check if there is a relation (and add one if there >> isn't). >> >> All this is one of the important changes in Net2.0, in Net2.0 there are >> TableAdapters, they are similar to DataAdapters except that now they are >> generated classes that are also configured inside the DataSet schema, >> just >> like typed DataTable's. >> >> >> HTH, >> Greetings >> >> >> > Covert your answers >> > >> > Thanks >> > Robert >> > >> > >> > >> >> > > HI,
Ok now that makes more sense. I would have to learn how to do this tho. Moving from one language to another is rather difficult. Robert Show quoteHide quote > And yes, you'll need to have a correct DataAdapter on each Form. So if you > have multiple Form's that need the same DataAdapter then you could consider > doing the DataAdapter configuration from a code file, class or module and > then use that instead of placing the same DataAdapter on multiple Forms. >
Why so much trouble with ellipses?
Seeking examples of screen scraping.... Setting MaxLength to <VBFixedString(x)>? GDI Question How Can I prevent a new row in datagrid But permit to edit existing cell ? Pasting from the clipboard HELP PLEASE !! DataGrid Questions VB.NET & Various Versions Of Outlook User Control and Namespace question Retrieving a webpage source HTM and checking for a string thereinL? |
|||||||||||||||||||||||