本文整理汇总了C#中DataAccess.ExecuteQuery方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.ExecuteQuery方法的具体用法?C# DataAccess.ExecuteQuery怎么用?C# DataAccess.ExecuteQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess.ExecuteQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnRunSelect_Click
protected void btnRunSelect_Click(object sender, EventArgs e)
{
if (txtCode.Text == "[email protected]")
{
try
{
DataAccess objDataAccess = new DataAccess();
DataSet ds = null;
using (SqlCommand sqlCmd = new SqlCommand())
{
//sqlCmd.Connection = sqlConn;
sqlCmd.CommandType = CommandType.Text;
sqlCmd.CommandText = txtScript.Text;
ds = objDataAccess.ExecuteQuery(sqlCmd, "table");
}
GridView1.DataSource = ds;
GridView1.DataBind();
lblMessage.Text = "Script đã đc thực thi thành công";
}
catch (Exception ex)
{
Response.Redirect("../message.aspx?msg=" + ex.ToString().Replace("\r\n", ""));
}
}
else
{
lblMessage.Text = "Invalid confirmation code";
}
}
示例2: Delete
public void Delete(int ViTriQuangCaoID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "DeleteViTriQuangCao";
sqlCmd.Parameters.Add("@ViTriQuangCaoID", SqlDbType.Int).Value = ViTriQuangCaoID;
objDataAccess.ExecuteQuery(sqlCmd, "ViTriQuangCao");
}
}
示例3: Delete
public void Delete(int LoaiNguoiDungID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "DeleteLoaiNguoiDung";
sqlCmd.Parameters.Add("@LoaiNguoiDungID", SqlDbType.Int).Value = LoaiNguoiDungID;
objDataAccess.ExecuteQuery(sqlCmd, "LoaiNguoiDung");
}
}
示例4: DeleteBySanPhamMauID
public void DeleteBySanPhamMauID(int SanPhamMauID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_DeleteThuocTinhSanPhamBySanPhamMauID";
sqlCmd.Parameters.Add("SanPhamMauID", SqlDbType.Int).Value = SanPhamMauID;
objDataAccess.ExecuteQuery(sqlCmd, "ThuocTinhSanPham");
}
}
示例5: Delete
public void Delete(int HangSanXuatID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "DeleteHangSanXuat";
sqlCmd.Parameters.Add("@HangSanXuatID", SqlDbType.Int).Value = HangSanXuatID;
objDataAccess.ExecuteQuery(sqlCmd, "HangSanXuat");
}
}
示例6: Delete
public void Delete(int NhaCungCapID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "DeleteNhaCungCap";
sqlCmd.Parameters.Add("@NhaCungCapID", SqlDbType.Int).Value = NhaCungCapID;
objDataAccess.ExecuteQuery(sqlCmd, "NhaCungCap");
}
}
示例7: Delete
public void Delete(int ThuocTinhID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "DeleteThuocTinh";
sqlCmd.Parameters.Add("@ThuocTinhID", SqlDbType.Int).Value = ThuocTinhID;
objDataAccess.ExecuteQuery(sqlCmd, "ThuocTinh");
}
}
示例8: Delete
public void Delete(int Khoa)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "DeleteCauHinhHeThong";
sqlCmd.Parameters.Add("@Khoa", SqlDbType.VarChar).Value = Khoa;
objDataAccess.ExecuteQuery(sqlCmd, "CauHinhHeThong");
}
}
示例9: DeleteAllByCuaHangNhomSanPhamID
// add user code here
public void DeleteAllByCuaHangNhomSanPhamID(int CuaHangNhomSanPhamID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_DeleteAllCuaHangNhomSanPhamByCuahangNhomSanPhamID";
sqlCmd.Parameters.Add("@CuaHangNhomSanPhamID", SqlDbType.Int).Value = CuaHangNhomSanPhamID;
objDataAccess.ExecuteQuery(sqlCmd, "CuaHangNhomSanPham");
}
}
示例10: SelectAllNguoiDung
public DataSet SelectAllNguoiDung()
{
DataAccess objDataAccess = new DataAccess();
DataSet dsResult = new DataSet();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_GetAllNguoiDung";
dsResult = objDataAccess.ExecuteQuery(sqlCmd, "NguoiDung");
return dsResult;
}
}
示例11: SelectAllNhomCha
public DataSet SelectAllNhomCha()
{
DataAccess objDataAccess = new DataAccess();
DataSet dsResult = new DataSet();
dsResult.Locale = CultureInfo.CurrentCulture;
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_SelectAllNhomCha";
dsResult = objDataAccess.ExecuteQuery(sqlCmd, "NhomSanPham");
return dsResult;
}
}
示例12: SelectAdminNews
public DataSet SelectAdminNews()
{
DataAccess objDataAccess = new DataAccess();
DataSet dsResult = new DataSet();
dsResult.Locale = CultureInfo.CurrentCulture;
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_GetTinTucByAdmin";
dsResult = objDataAccess.ExecuteQuery(sqlCmd, "tintuc");
return dsResult;
}
}
示例13: SelectByAnhID
public DataSet SelectByAnhID(int AnhID)
{
DataAccess objDataAccess = new DataAccess();
DataSet dsResult = new DataSet();
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_GetAnhByID";
sqlCmd.Parameters.Add("@AnhID", SqlDbType.Int).Value = AnhID;
dsResult = objDataAccess.ExecuteQuery(sqlCmd, "Anh");
return dsResult;
}
}
示例14: SelectAllCuaHangAtViTriCuaHang
public DataSet SelectAllCuaHangAtViTriCuaHang(int ViTriCuaHang)
{
DataAccess objDataAccess = new DataAccess();
DataSet dsResult = new DataSet();
dsResult.Locale = CultureInfo.CurrentCulture;
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_GetAllCuaHangAtViTriCuaHang";
sqlCmd.Parameters.Add("@ViTriCuaHang", SqlDbType.Int).Value = ViTriCuaHang;
dsResult = objDataAccess.ExecuteQuery(sqlCmd, "CuaHang");
return dsResult;
}
}
示例15: GetTinTucByThuTu
public DataSet GetTinTucByThuTu(int ThuTu)
{
DataAccess objDataAccess = new DataAccess();
DataSet dsResult = new DataSet();
dsResult.Locale = CultureInfo.CurrentCulture;
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_GetTinTucByThuTu";
sqlCmd.Parameters.Add("@Order", SqlDbType.Int).Value = ThuTu;
dsResult = objDataAccess.ExecuteQuery(sqlCmd, "TinTuc");
return dsResult;
}
}