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 ();
|
No responses found. Be the first to respond and make money from revenue sharing program.
|