Binding a Windows form to a TableAdapter through a Web Service

How can I use a TableAdapter object in a Windows Form aplication, when this TableAdapter object is returned from a Web Service? It's simple, but...

I wanted a simple thing:
1- define a TableAdapter in a Web Service project, to get a typed DataSet from the BD
2- return this TableAdater in a WebMethod
3- use the TableAdapter returned by the web service from a DataGridView in a Windows form application (referencing the web service, of course).

I tried many combinations before getting this worked, playing with objects and properties, and googling, and playing again... There is finally a recipe that works:

On the web service side:

  1. Create a TableAdapter (by dragging adatabase table from the werver explorer and settinga select method). This create a DataSet (name of the *.xsd file), a DataTable (name in the top of the box) and a TableAdapter (with a "TableAdapter" suffix after the DataTable name).
  2. Create a web method returning an instance of the new DataTable.
On the windows application side:
  1. In the Windows client project, add a Web Reference to the class of the web service (like the default name "Service1").
  2. Next, go on the design view of the web form. On the toolbox pane, some items are automatically added. There should be an item with the DataSet used in the web service; the name will be the "*.xsd" file name, not the DataTable or the TableAdapter name (default will be "DataSet1"). This should be in a section of the toolbox labeled with the web service namespace ("MyWebService components"). Drag this component on the web form. A DataSet object will be created.
  3. Drag a BindingSource on the web form
  4. In the properties of the new BindingSource object, set the datasource to the new DataSet objet. In the DataMember drop down list, you can now choose the name of the DataTable (similar to the TableAdapter name) within the DataSet.
  5. In the DataGridView control properties, set the DataSource to the new DataBindingSource object.
  6. All properties shoud now be ok.

To get the data populating the DataGridView on load, there is a line to write.In the Load() event of the form, add something like
Me.BindingSource1.DataSource = New [WebReferenceAliasName].[ServiceName]().[WebMethodName]()

It works fine this way.

28 comments:

Anonymous said...

Thinking about getting a car insurance quote?
[url=http://safe-car.org]Car Insurance[/url]
A growing number of people are dropping their auto insurance to try to save money, according to a recent study by the Insurance Research Council (IRC). If the current rate of unemployment continues, the IRC estimates that the national uninsured rate will climb from 13.8 percent in 2007 to 16.3 percent in 2010. With that many people driving without coverage, it's dangerous to be uninsured. But how much car insurance do you really need?
If you're like many people feeling the pinch, your inclination is to get the bare minimum of insurance coverage required by the law in your state. That's a good place to start, though those minimums may not fully protect you -- or your assets -- if you file a claim. We recommend getting more than the minimum coverage unless you are driving a beater and have no assets to protect.

Visit [url=http://safe-car.org]Safe-car.org[/url]
All you need to know about
[url=http://safe-car.org]Car Insurance[/url]

Anonymous said...

Hello! I'm newbie in Internet, can you give me some useful links? I know only about Yahoo [url=http://yahoo.com]Yahoo[/url] http://yahoo.com Yahoo

Anonymous said...

http://catur.web.id/forum/index.php/topic,6073.0.html
http://www.cblaracha.com/foro//posting.php?mode=reply&f=3&t=1088
http://www.f1team.com.br/forum/showthread.php?p=6920

Anonymous said...

buy cheapest flagyl buy in online usa lasix order kamagra oral jelly online without prescription discount buy Lexapro online Order Online Clomid (Serophene) Free Buy Levonorgestrel Online Pharmacy Cod Levonorgestrel bad effects side avodart Lipitor cod saturday delivery Buy Flagyl ER in US

Term Papers said...

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

Anonymous said...

[url=http://www.sigcas.org/Members/merlinbaxter/totaled-cars-without-insurance]Car Cheap Insurance Jersey Nes[/url] [url=http://www.physikclub.de/Members/freemanfranks/car-insurance-lexington]Insurance Quote Car Online Cheap[/url] [url=http://www.openvote.net/Members/franksnyder/ontario-insurance-company-auto/]Car Insurance Quotes For Ma[/url] [url=http://www.prolearn-academy.org/Members/nedrakessler/auto-insurance-cheap-uk]Progressive Car Insurance In America[/url] [url=http://www.durban.gov.za/durban/Members/wilburkane/medical-experts-for-auto-insurance]Classic Car Part Auto Cheap Insurance[/url]

Anonymous said...

Welcome! you look
[url=http://shemale.hqporn.us/][img]http://pics.hqtube.com/gallery/double_dip-her_3_sc3_3.jpg[/img][/url] [url=http://teen.hqporn.us/][img]http://pics.hqtube.com/gallery/girls_home_alone_27_sc6_2.jpg[/img][/url] [url=http://pussy.hqporn.us/][img]http://pics.hqtube.com/gallery/amateur_hardcore_1_sc1_2.jpg[/img][/url] [url=http://gay.hqporn.us/][img]http://pics.hqtube.com/gallery/talking_bout_white_chix_1_sc4_3.jpg[/img][/url]
P Only 3X new [url=http://squirts.hqporn.us/]glasses porn [/url] , hardcore teen porn [url=http://milf.hqporn.us/]danger dave porn [/url] or porn nextdoor [url=http://join.hqtube.com/track/qx4DABkR/]gay teens porn [/url] , lesbian porn mp4 [url=http://tube.hqporn.us/]my friends hot mom porn site [/url] or rave porn [url=http://shemale.hqporn.us/]free ametuer porn [/url] , porn games free [url=http://join.hqtube.com/track/qx4DABkR/]free ebony porn websites [/url] and doctor porn [url=http://gay.hqporn.us/]girl next door porn [/url] or free foot fetish porn [url=http://www.hqtube.com/?5736000000/]free porn star videos [/url] , 0 clips of Anal : stacy silver gets two cocks and one messy cream pie [url=http://www.priority.be/b-smart/modules.php?name=Forums&file=viewtopic&p=638233#638233]porn for the iphone [/url] . Need someone to fuck tonight or free sex? Then go straight to Dating page and make an appointment with hot ladies and guys. Find you soul mate among big tits honeys, choose sex partner from most pervert fetish addicts, group sex fans, swingers and many others! [url=http://lagoszone.com/phpBB2/viewtopic.php?p=70840#70840]just free porn [/url] . F Cum Filled Throats new [url=http://iclancat.net/alternatiu/viewtopic.php?f=13&t=52211&p=594554#p594554]free cameltoe porn [/url] . 3 clips of Amateurs : small tits cute blonde teen ashley lace blowjob and fucking you missionary [url=http://voxprompt.com/bb/viewtopic.php?p=455482#455482]mature black porn [/url] . Pretty starlets get seduced and find a taste of a hot pussy very exciting. [url=http://lagflug.is/phpBB2/viewtopic.php?p=182315#182315]bloopers porn [/url] , Category: FREE > Straight > Teens [url=http://gay.hqporn.us/]you tube porn [/url] , making porn [url=http://teen.hqporn.us/]free bbw porn videos [/url] or cheap porn dvds [url=http://teen.hqporn.us/]mermaid porn [/url] , teen art porn [url=http://join.hqtube.com/track/qx4DABkR/]free gay porn games [/url] or asian 911 tpg porn thumbs [url=http://join.hqtube.com/track/qx4DABkR/]free porn gay [/url] , lesbian free porn [url=http://lesbian.hqporn.us/]free hardcore asian porn [/url] and action 36 porn [url=http://tube.hqporn.us/]porn gallery [/url] or nude free porn [url=http://japan.hqporn.us/]zoids porn [/url] , 3 clips of Anal : brunette teen gets her asshole filled with two cocks [url=http://www.mandiralmere.nl/slnma_forum/viewtopic.php?p=297164#297164]game porn [/url] . F Virtuagirl Rachel Roxx new [url=http://www.capitaldubs.com/forums_old/viewtopic.php?f=6&t=86409]free female bodybuilder porn [/url] . One lucky stud bangin 4 teenie lovely holes in these vids. [url=http://www.tecnologiamecanica.com/foro//viewtopic.php?p=337331#337331]latinas ramon porn [/url] . PREMIUM DVDs [url=http://mmsteam.free.fr/Aztek/forum_1.php?cit=29]porn fidelity [/url] . P Breast Palace new [url=http://fobialounge.com/foorumi/viewtopic.php?p=197338#197338]porn tubes [/url] , of good purchases.....

Anonymous said...

Hello! check
[url=http://granny.hqporn.us/][img]http://pics.hqtube.com/gallery/teachers_pet_3_sc2_1.jpg[/img][/url] [url=http://tube.hqporn.us/][img]http://pics.hqtube.com/gallery/kelly_the_coed_17_sc2_2.jpg[/img][/url] [url=http://japan.hqporn.us/][img]http://pics.hqtube.com/gallery/true_college_girls_2_sc5_2.jpg[/img][/url] [url=http://join.hqtube.com/track/qx4DABkR/][img]http://pics.hqtube.com/gallery/kelly_the_coed_19_sc2_2.jpg[/img][/url]
Category: FREE > Fetish > Voyeur&Upskirts [url=http://tube.hqporn.us/]comic porn [/url] , gay porn clips [url=http://japan.hqporn.us/]underground porn [/url] or small boob porn [url=http://teen.hqporn.us/]limo porn [/url] , android 18 porn [url=http://teen.hqporn.us/]free masturbating porn [/url] or free porn viedos [url=http://shemale.hqporn.us/]70s porn stars [/url] , free phone porn [url=http://teen.hqporn.us/]free porn full [/url] and interracial lesbian porn [url=http://japan.hqporn.us/]paris hilton porn video free [/url] or young schoolgirl porn [url=http://shemale.hqporn.us/]soft porn pics [/url] , 16 pics of Babes : good times at a south beach sex party [url=http://bn171.webd.pl/klasa/viewtopic.php?p=312646#312646]swedish porn galleries [/url] . 3 clips of Anal : brunette teen gets her asshole filled with two cocks [url=http://www.beancotton.com/cgi-bin/show_picture.cgi?pic=22&width=551&height=480]free asain porn [/url] . 15 pics of Ass : sexy babes on their way to orgasm [url=http://orthofundinggroup.com/phpBB2/viewtopic.php?p=102254#102254]latvian porn [/url] . Category: FREE > Straight > Interracial [url=http://pallarssobira.ddl.net/telecentre/phpBB2/viewtopic.php?p=190179#190179]free hardcore porn vids [/url] . 15 pics of Interracial : ashli orion gets banged doggystyle by a black guy [url=http://stylexhibit.com/phpBB3/viewtopic.php?f=6&t=28496&p=104108#p104108]hot teen babysitter porn [/url] , P Naughty America new [url=http://granny.hqporn.us/]youtube amiture porn [/url] , online free porn movies [url=http://join.hqtube.com/track/qx4DABkR/]vanity the porn star [/url] or cartoon porn games [url=http://lesbian.hqporn.us/]rate porn movies [/url] , junior porn [url=http://shemale.hqporn.us/]private porn wars [/url] or n95 porn [url=http://granny.hqporn.us/]free celebrity porn [/url] , young naked porn [url=http://shemale.hqporn.us/]asain porn [/url] and maori porn [url=http://www.hqtube.com/?5736000000/]illegal russian porn [/url] or football porn [url=http://gay.hqporn.us/]free porn eraser [/url] , P Naughty America new [url=http://www.bizmarcker.de/phpBB2/viewtopic.php?p=571448#571448]hardcore black porn [/url] . Japanese lassies suzuka ishihara and asami yoshikawa get shugged deep and hard. [url=http://www.keanthai.com/phpbbthai/phpBB/viewtopic.php?p=131062#131062]columbian porn [/url] . Lengthy legs spread wide to open that lustful pink eye placed between them [url=http://engsci.utoronto.ca/old/punbb-1.2.15/viewtopic.php?pid=132035#p132035]free streaming porn [/url] . Free to browse all our free porn categories, such as asian, anal, lesbian, hardcore, gangbang, and teen. Be sure to check back often at Porn 8 because new videos are added to the categories every 30 minutes! With this many porn movies added daily you will always be able to find something fresh to jerk it to! [url=http://www1.shellkonto.se/umk/phpforum/viewtopic.php?p=152661#152661]index of porn [/url] . A $1 trial membership signs you up to 6 adult mega sites. Need I say more? Adult Gold Access is the one stop shop of adult entertainment. Check it out. How can you go wrong? $1 for porn, comics, celebs and more. Sign up today and see for yourself how fabulous Adult Gold Access is. [url=http://cpgunderground.com/phpBB2/viewtopic.php?p=110088#110088]teen porn star [/url] , everything.....

Anonymous said...

Cool flash games. Don't miss!!!

Anonymous said...

big ass booty You read this and think .... A salary of between 5% per day Just do not believe I thank you - for the warm welcome) I like your posts I like your posts I NRA) is a good idea. Happiness - not a reward for virtue, but virtue itself, not because we enjoy the happiness that curb their passions, but rather enjoy the happiness makes us able to curb them. - Spinoza class) I ponra) especially!

Anonymous said...

naughty teachers having sex at school This unrivaled Classroom paper, by the way the author would like to offer yandeks.deneg chip set from the site, "Give the ruble." I would give, so to speak on the maintenance. Thank you very much! I took a too-handy. A huge Thank you to you! and more posts on this topic will be in the future? It is waiting! The site just super, I will recommend to friends! Wine and women bring to us Super! Everything is very clear and competently, and at the same time without philosophising and narcissism, and in accessible language. Rare case when a person is divided into topical and interesting infoy. Thanks to author! IMHO, the author is wrong

Anonymous said...

ugly tits Well of course tin ... cool п»їVery interesting! Not very often can not understand how to update your blog? Belief in success - is the driving force and sin not to use it for their own personal goals. class) I ponra) especially! Really? amazing. Thanks to a huge, super article. Few feelings .. but nice ...

Anonymous said...

bachelor party adult read with pleasure You know now who rarely writes on the subject, very pleasant to read, I would advise to add more pictures! This unrivaled Cool somewhere I have already seen this ... fantastic! ... Do you RSS in a curve encoding! STUDY theme!

Anonymous said...

adult emotions for msn messenger Exl how old dupe! п»їVery interesting! Not very often can not understand how to update your blog? The morning began with a wonderful article, thank you! Well of course tin ... So engrossed that I missed a football I thank you - for the warm welcome) I thank you - for the warm welcome) Very good site, but not bad-would make a version for smartphones.

Anonymous said...

free mom and son sex Few feelings .. but nice ... Yes, the news went on inetu and distributed by starshnoy force Accidentally saw. Not expect. very nice, so we would have done so Thanks for the post, and this issue This unrivaled rasskau you also an interesting story .. A huge thank you to a human, a very topical note.

Anonymous said...

adult fairy tatoo A huge thank you to a human, a very topical note. fantastic! ... Interestingly, and cognitive, and will have something on this subject? Accidentally saw. Not expect. I like your posts On your blog, familiar in the ICQ link tossed. It turned out that nothing I liked. Tepr always read will Wine and women bring to us Thanks to a huge, super article.

Anonymous said...

jessica alba tits Content is interesting, learned a lot. I recommend everyone to read. I can not understand what was happening, but my current 2 images loaded. (((A vasche liked! read with pleasure The author, and you are out of town? they were more Very good site, but not bad-would make a version for smartphones. You know now who rarely writes on the subject, very pleasant to read, I would advise to add more pictures! Happiness - not a reward for virtue, but virtue itself, not because we enjoy the happiness that curb their passions, but rather enjoy the happiness makes us able to curb them. - Spinoza

Anonymous said...

adult swings Belief in success - is the driving force and sin not to use it for their own personal goals. Just do not believe Do you RSS in a curve encoding! they were more All zdryam! Today marked the second anniversary maintaining your blog. Congratulations on not imposing ourselves, we would like to know the author and perhaps a comment: and what time you run your resource? Frankly, had difficult moments, when visited by the thought to throw this case. First, because of the departure of the index of PS Yandex, later - due to lack of time. But after a while you begin to understand that it is sometimes useful to lay out on the list (in this case on the web page your thoughts, share something interesting with our readers. The author of this resource would like to wish the inspiration for the new positions will never leave! Good luck ... I do not know about you, but I like it! There is. Super! Everything is very clear and competently, and at the same time without philosophising and narcissism, and in accessible language. Rare case when a person is divided into topical and interesting infoy. Thanks to author! Smoothly write, young man, and I still can not go, sloppy somehow beyond the text from the pen I think this is correct with time.

Anonymous said...

hot gay sperm read with pleasure You read this and think .... cool .. took almost all)) Do you RSS in a curve encoding! Added to your bookmarks. Now will you read much more often! And you know what a holiday today? Who is mulberry? All true, but how else? Happiness - not a reward for virtue, but virtue itself, not because we enjoy the happiness that curb their passions, but rather enjoy the happiness makes us able to curb them. - Spinoza

Anonymous said...

xnxx flash porn I NRA) is a good idea. Blog just super, I will recommend to friends! moskvasoset i ne ebet! In my opinion you stole this article and placed on another site. I had already seen. Blog just super, I will recommend to friends! Yes, but it's not all ... I hope it will still cool IMHO, the author is wrong

Anonymous said...

nude celebrities sex clips decided to help and sent out a post in the soc. bookmarks. hope to rise in popularity Thanks to a huge, super article. Most people are happy as much as they have decided to be happy. - A. Lincoln Yeah, sure, that there still might say. IMHO, the author is wrong Happiness - not a reward for virtue, but virtue itself, not because we enjoy the happiness that curb their passions, but rather enjoy the happiness makes us able to curb them. - Spinoza Yes, but it's not all ... I hope it will still Laugh not a sin, but admit it when you read this information at least surprised me:))

Anonymous said...

gay lesbian wap Interestingly, and cognitive, and will have something on this subject? Few feelings .. but nice ... Well without untoward happens - even a schoolboy on holiday give job. - Charles Lamb The author, and you are out of town? Your site in the opera is not the adjustment is shown, and everything is fine! спасибки you for your clever ideas! Actions do not always bring happiness, but there is no happiness without action. - B. Disraeli Blog super, everything would be different! moskvasoset i ne ebet!

Anonymous said...

cheap ass gamer class) I ponra) especially! Belief in success - is the driving force and sin not to use it for their own personal goals. blog in my favorites Interesting Login or register, but you should add more articles and how difficult it is to your own blog? I can not understand what was happening, but my current 2 images loaded. (((A vasche liked! They like. Must be waiting to continue. This topic is certainly of interest to all. Content is interesting, learned a lot. I recommend everyone to read.

Anonymous said...

men masturb On your blog, familiar in the ICQ link tossed. It turned out that nothing I liked. Tepr always read will You normally happy about us with the best phrases thanks, take! Blog super, everything would be different! A great portal, but it's worth more to add information read with pleasure Really? amazing. moskvasoset i ne ebet! IMHO, the author is wrong

Anonymous said...

adult education teacher positions las vegas share: but we have to work all pouvolnyali, and what to do now? Most people are happy as much as they have decided to be happy. - A. Lincoln You read this and think .... Thank you! Article interesting. Excellent post, after reading several articles on the subject realized that everything did not look on the other hand, a post once very interested. Oh, thank you. On your blog, familiar in the ICQ link tossed. It turned out that nothing I liked. Tepr always read will All zdryam! Today marked the second anniversary maintaining your blog. Congratulations on not imposing ourselves, we would like to know the author and perhaps a comment: and what time you run your resource? Frankly, had difficult moments, when visited by the thought to throw this case. First, because of the departure of the index of PS Yandex, later - due to lack of time. But after a while you begin to understand that it is sometimes useful to lay out on the list (in this case on the web page your thoughts, share something interesting with our readers. The author of this resource would like to wish the inspiration for the new positions will never leave! Good luck ...

Anonymous said...

classic native american legends leah remini smoking showare center kent wa smoking pregnancy raquel welsh photos winston churchill food preservation by smoking smoking cessation medication the ram at kent street station

Anonymous said...

maine porn A long time ago I started this blog? decided to help and sent out a post in the soc. bookmarks. hope to rise in popularity Greatest number of people can join only the lowest common denominator. - FA Hayek I read a similar article on this subject, but you have quite a different opinion, thanks, it was interesting to compare Many find useful for themselves Accidentally saw. Not expect. Really? amazing. Thank you! In quotations!

Anonymous said...

gay panama I like your posts Why have a blog such attendance is low ... the way to put things in your blog or deterioration, will help remove Thank you! In quotations! You read this and think .... A salary of between 5% per day Here you decided to help a bit, and sent this post to social bookmark. I really hope your ranking will increase. I NRA) is a good idea. Just do not believe A huge thank you to a human, a very topical note.