Posted By: G. Andrew Duthie | Jun 5th, 2006 @ 5:21 AM | 59,133 Views | 14 Comments
One of the cool new features of ASP.NET 2.0 is its rich declarative databinding. In addition to traditional techniques like databinding to a back-end SQL database, you can also databind to web services, using the ObjectDataSource.

In this DevNugget, Mid-Atlantic .net Developer Evangelist G. Andrew Duthie (aka .net DEvHammer) shows you how you can very quickly create a web service to return structured data using a .net 2.0 DataSet class, then how you can easily bind your web service to an ASP.NET 2.0 GridView control using the ObjectDataSource, including both displaying and updating data.
Media Downloads:
Rating:
1
0
guercheLE
guercheLE
guerchele

Does DataGridView have an "Enable insert" option? I have not found such feature in DataGridView so far. Would you mind giving us directions to it?

Kindly regards,

Luciano Evaristo Guerche
Taboao da Serra, SP, Brazil

guercheLE wrote:


Does DataGridView have an "Enable insert" option? I have not found such feature in DataGridView so far. Would you mind giving us directions to it?

Disclaimer: I haven't actually watched the video.

That said, a GridView doesn't provide an configurable means of inserting new data, i.e. there is no "enable insert" option.  The GridView control does inherit the ability to support insert operations via an InsertCommand, much like a SelectCommand or DeleteCommand.  You must write this manually, though.  Furthermore, I found it necessary to create FooterTemplates to support this data entry and to create an EmptyDataTemplate to allow entry of initial items.

So, as mentioned: it can be done, but I think there are easier ways to do what you want.

Regards,
Jim Greer
I have an application where I have a datagrid on a form, populated with data from a web service and I want to create relationships with mdf database tables within the same application.

I am self teaching and sometimes it is very hard to grasp basic concepts. This video is more advanced than me, please can anyone guide me with the basic concept of how I can create relationships between a database table and a web service datagrid.

Thanks

stampcoverman
VOE
VOE
Vroom!
Hi G. Andrew,

   Great information. I learned quite a bit. Even that this one will only run once. What am I to do with that <app settings for a dynamic port? Turn that feature off? Rebuild the web reference every time?

This one was fun to learn from. I downloaded the swf file and ran it in Irfanview. I must of got a glitch in the transfer though as Irfanview locked up just about at the end of building the service provider. Flash players are cool though. I wish more control was avalible like in most video players, you know the slider? It did run okay in IE and Firefox.

   I saw the one on code snippets and started browsing the help files for more information on downloading them but it just gave me the run around. More on this would be cool because you use a screen cam not that I minded looking at Lisa. lol

VOE(Visual Objects Environment) de KB9AGT signing off.Smiley


P.S. I cannot run IIS on XP Home Edition.[C]
This is great! Smiley

Finally, I have found what I needed. I have been searching all over the internet for binding a webservice to a datagrid.

I am new to web services. And, I have definitely been doing things the hard way. So, I need to have the web service create a method where it is using the table adapter? This way I can choose an Object as my data source and then have it point to my web service? Does it matter that I am referencing a WSDL instead of asmx file?

I have been choosing (none) as my data source and then binding the grid programmatically. I think the person who is providing me the WSDL is not sending me the correct web methods.

Thanks.
Is it possible to use this method with some form of WSE3 security?  I'd like to be able to use a usernameTokenSecurity policy.  I know how to set the web service up with this but how do I get the consumer to supply the credentials?
How can i make this in c#?
thanks for the sample

How i can changue the url of the webreference?
changue the url in code or in config

Thanks
Microsoft Communities