// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Data; using System.Data.SqlClient; using System.Web.Services; namespace E { public class DataGateway3 { [WebMethod] public DataSet GetDS() { SqlConnection con = new SqlConnection("server=ARNEPC3;Integrated Security=SSPI;database=Test"); con.Open(); SqlDataAdapter da = new SqlDataAdapter("SELECT F1,F2 FROM T1", con); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return ds; } } }