C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » WCF/Webservices »

Database Connectivity using WebService


Posted Date: 15 Oct 2009    Resource Type: Articles    Category: WCF/Webservices
Author: NirajMember Level: Silver    
Rating: 1 out of 5Points: 2 (Rs 5)



In this article, Web services, how to use databases, Web shows how to retrieve data using the service. Behavior of Web services, Web services and remote method calls to the published Web server, and allow the soap client, which supports Web Services Description Language (fast) 1.1. This phenomenon is to use soap and influence without the knowledge and experience in the implementation of development opportunities. Web service operation, soap, blocks, and supports a wide range of data types including basic data types of objects, XML data.

Conversion service on the Internet, the weather, and provide services such as application components, or in the language.

Ideally, each component of the application to use applications that only he types.

Since the compatibility of Web services-based application is another useful method to solve the problem by combining the data.

Another application is using a network service that can exchange data across different platforms.

I am the default database application using all the data you use. Web service class, the development of this method on the Internet. I Northwind customer table in the database.


[WebMethod the (description = "client table") assigned to each client]

The data published GetLatestCustomers () set

(
(Use the SqlConnection = new SqlConnection
(ConfigurationManager.ConnectionString "dataConnectionString"]. "ConnectionString S))

(
String query = "SELECT * FROM [Customers] [Customer Order ID] DESC";

A SqlCommand = new SqlCommand (query, connection);

The command.CommandType = CommandType.Text;

The Connection.Open ();

SqlDataReader reader = Command.ExecuteReader ();



The mytable = new DataTable ( "MyTable that"), the DataTable;

myTable.Columns.Add ( "CustID", typeof operator (string));

myTable.Columns.Add ( "Company", typeof operator (string));

myTable.Columns.Add ( "Contact", typeof operator (string));

myTable.Columns.Add ( "class" operator typeof (string));

myTable.Columns.Add ( "Address", typeof operator (string));

myTable.Columns.Add ( "City", typeof operator (string));

myTable.Columns.Add ( "old" operator typeof (string));

myTable.Columns.Add ( "PostalCode", typeof operator (string));

myTable.Columns.Add ( "country", typeof operator (string));

myTable.Columns.Add ( "Phone", typeof operator (string));

myTable.Columns.Add ( "Fax", typeof operator (string));



While (reader.Read ())

(
myTable.Rows.Add (new Object []

(

Reader [ "CustomerID"]. return toString (), reader [ "Company Name"]. return toString (),
Reader [ "Contact"]. return toString (), reader [ "class"], reader
[ "Title"], reader [ "city"], reader [ "Region"], reader [ "PostalCode"]
Reader [ "Country"], reader [ "phone"], reader [ "Fax "]));

)

/ / MyTable.Load (reader);

myTable.AcceptChanges ();

The new data set X = data ();

() Ds.Tables.Add to MyTable;

ds.AcceptChanges ();

X return;

)
)

//App_Code folder in the classroom. I was on the page to display the GPRS //GridView control.



//Such an invitation now to create an object:

Service service = new Service ();

//The page load event code, the development of these two lines.

GridView1.DataSource = service.GetLatestCustomers ();
GridView1.DataBind ();





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Compatibility of Web services-based application  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: .Net Questions Part--5
Previous Resource: WCF and Forms authentication
Return to Discussion Resource Index
Post New Resource
Category: WCF/Webservices


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use