第一次翻译文档,如有问题敬请原谅并指教!
'Visual Basic <WebMethod()> Function GiveMeADataTable() As System.Data.DataTable Dim conn As New System.Data.SqlClient.SqlConnection("Server=YourServer;Initial Catalog=pubs;Integrated Security=SSPI;") Dim ds As New System.Data.DataSet() Dim adapter As New System.Data.SqlClient.SqlDataAdapter() adapter.SelectCommand = New System.Data.SqlClient.SqlCommand("Select * From Authors", conn) adapter.Fill(ds, "Authors") Return ds.Tables("Authors") End Function
//Visual C# [WebMethod] public System.Data.DataTable GiveMeADataTable() { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("Server=YourServer;Initial Catalog=pubs;Integrated Security=SSPI;"); System.Data.DataSet ds = new System.Data.DataSet(); System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(); adapter.SelectCommand = new System.Data.SqlClient.SqlCommand("Select * From Authors", conn); adapter.Fill(ds, "Authors"); return ds.Tables["Authors"]; }
/**Visual J# */ /** @attribute WebMethod() */ public System.Data.DataTable GiveMeADataTable() { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("Server=YourServer;Initial Catalog=pubs;Integrated Security=SSPI;"); System.Data.DataSet ds = new System.Data.DataSet(); System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(); adapter.set_SelectCommand(new System.Data.SqlClient.SqlCommand("Select * From Authors", conn)); adapter.Fill(ds, "Authors"); System.Data.DataTableCollection dtc = ds.get_Tables(); return dtc.get_Item("Authors"); }
'Visual Basic <WebMethod()> Function GiveMeADataSet() As System.Data.DataSet Dim conn As New System.Data.SqlClient.SqlConnection("Server=YourServer;Initial Catalog=pubs;Integrated Security=SSPI;") Dim ds As New System.Data.DataSet() Dim adapter As New System.Data.SqlClient.SqlDataAdapter() adapter.SelectCommand = New System.Data.SqlClient.SqlCommand("Select * From Authors", conn) adapter.Fill(ds, "Authors") Return ds End Function
//Visual C# [WebMethod] public System.Data.DataSet GiveMeADataSet() { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("Server=YourServer;Initial Catalog=pubs;Integrated Security=SSPI;"); System.Data.DataSet ds = new System.Data.DataSet(); System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(); adapter.SelectCommand = new System.Data.SqlClient.SqlCommand("Select * From Authors", conn); adapter.Fill(ds, "Authors"); return ds; }
/**Visual J# */ /** @attribute WebMethod() */ public System.Data.DataSet GiveMeADataSet() { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("Server=YourServer;Initial Catalog=pubs;Integrated Security=SSPI;"); System.Data.DataSet ds = new System.Data.DataSet(); System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(); adapter.set_SelectCommand(new System.Data.SqlClient.SqlCommand("Select * From Authors", conn)); adapter.Fill(ds, "Authors"); return ds; }
本文地址:http://com.8s8s.com/it/it45260.htm