Senior & Expert .Net Developers Discussion Forum by Nyros Technologies

HIRE .Net Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

ASP.Net GridView data binding using web service with c#

 
Post new topic   Reply to topic    Senior & Expert .Net Developers Discussion Forum by Nyros Technologies Index -> Web Services and other distributed Technologies
View previous topic :: View next topic  
Author Message
vamsy



Joined: 21 Aug 2007
Posts: 60

PostPosted: Mon Mar 10, 2008 7:00 am    Post subject: ASP.Net GridView data binding using web service with c# Reply with quote

Hi experts,
i want to bind GridView with the help of web service. can any one let me know how to create web service for this application and how to consume it.
thanking you in advance........please let me know in detail.

with regards,
chandu....
Back to top
View user's profile Send private message Send e-mail
muralikrishna



Joined: 21 Aug 2007
Posts: 36

PostPosted: Mon Mar 10, 2008 7:10 am    Post subject: Reply with quote

hi,
I got the solution for your query. here is the following code snippet for database interaction with the help of web service and populating data from data base.

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://localhost:3694/InsertService/Service.asmx?WSDL")]

[WebMethod(Description = "Selcect By Employee First Name", BufferResponse = true)]
public DataSet Select(string FirstName)
{

SqlCommand Selectcmd = new SqlCommand("select * from employees where firstname='" + FirstName + "'", con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(Selectcmd);
da.Fill(ds);

return ds;
}


in the above few lines of code Web Method Select will returns a data set. and this will give the data about employees by taking first name as a input string.

enjoy the article....
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert .Net Developers Discussion Forum by Nyros Technologies Index -> Web Services and other distributed Technologies
Page 1 of 1


 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts How to Add Update Delete for gridview using Webservice
1 sanjay 31 Fri Sep 10, 2010 7:05 am
setty View latest post
No new posts Is there any free webhosts that support ASP.NET. ?
2 Balaji 634 Tue Sep 07, 2010 10:24 am
chrisadam View latest post
No new posts Hostings For ASP.NET 2.0 with SQL Server
2 Avash 676 Tue Sep 07, 2010 10:21 am
chrisadam View latest post
No new posts Exceptional Manger
1 suraj 51 Thu Sep 02, 2010 8:52 am
Rahul View latest post
No new posts background image for UITableView
0 kumar 55 Wed Sep 01, 2010 10:34 am
kumar View latest post
No new posts Types of Run time exceptions
1 Dheeraj 52 Wed Sep 01, 2010 8:58 am
venkat View latest post
No new posts Access Web Page content in Windows Forms without WebBrowser
3 mouli 273 Wed Sep 01, 2010 7:31 am
rajesh View latest post
No new posts Explain Interlocked Class & Daemon Thread's?
1 mukundh 76 Wed Sep 01, 2010 7:19 am
setty View latest post
No new posts Life Cycle Of Delegate
0 vinay 40 Wed Sep 01, 2010 7:14 am
vinay View latest post
No new posts Accessing methods defined in another page
1 suraj 37 Tue Aug 31, 2010 12:45 pm
Rahul View latest post




Hire an expert .Net developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   PHP   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About .Net Experts   |   More