Classe de negócio (1/2)
•using System.Data;
•using System.Data.SqlClient;
•public class DataAccess
•{
• public static DataSet GetCategories()
• {
•string conexao = "Database=northwind;server=(local);user id=sa ";
•string sql = "SELECT * FROM Categories";
•SqlConnection conn = new SqlConnection(conexao);
•SqlCommand command = new SqlCommand(sql, conn);
•SqlDataAdapter adapter = new SqlDataAdapter(command);
•DataSet ds = new DataSet();
•adapter.Fill(ds);
•return ds;
–}
•}