?? service.cs
字號:
?using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.OleDb;
using System.Data;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service()
{
//如果使用設計的組件,請取消注釋以下行
//InitializeComponent();
}
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public DataSet GetQueryResult(String MySQL)
{
OleDbConnection MyConnection = new OleDbConnection(@"Provider= Microsoft.Jet.OLEDB.4.0;Data Source=Northwind.mdb");
OleDbCommand MyCommand = new OleDbCommand(MySQL, MyConnection);
MyConnection.Open();
DataSet MySet = new DataSet();
OleDbDataAdapter MyAdapter = new OleDbDataAdapter(MyCommand);
MyAdapter.Fill(MySet);
MyConnection.Close();
return MySet;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -