using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
public class RecDAL
{
public static string connStr = ConfigurationSettings.AppSettings["connectionString"];
SqlConnection con = new SqlConnection(connStr);
SqlCommand cmd;
public DataTable getLogin(EntRec rr)
{
con.Open();
cmd = new SqlCommand("sp_Login", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@uname", rr.userName);
cmd.Parameters.AddWithValue("@pwd", rr.Pwd);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
return dt;
}
public DataTable LoadData()
{
DataTable dt = new DataTable();
cmd = new SqlCommand("sp_LoadFullData", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
return dt;
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
public class RecDAL
{
public static string connStr = ConfigurationSettings.AppSettings["connectionString"];
SqlConnection con = new SqlConnection(connStr);
SqlCommand cmd;
public DataTable getLogin(EntRec rr)
{
con.Open();
cmd = new SqlCommand("sp_Login", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@uname", rr.userName);
cmd.Parameters.AddWithValue("@pwd", rr.Pwd);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
return dt;
}
public DataTable LoadData()
{
DataTable dt = new DataTable();
cmd = new SqlCommand("sp_LoadFullData", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
return dt;
}
}
}
No comments:
Post a Comment