本文整理汇总了C#中DataAccess.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.ExecuteScalar方法的具体用法?C# DataAccess.ExecuteScalar怎么用?C# DataAccess.ExecuteScalar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess.ExecuteScalar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? SanPhamID, int? NguoiDungID, decimal? GiaMuonMua, int? SoLuong,
string ChiTiet, int? Bak1, bool? Bak2)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsTraGiaSanPham";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@SanPhamID", SqlDbType.Int).Value = SanPhamID;
sqlCmd.Parameters.Add("@NguoiDungID", SqlDbType.Int).Value = NguoiDungID;
sqlCmd.Parameters.Add("@GiaMuonMua", SqlDbType.Money).Value = GiaMuonMua;
sqlCmd.Parameters.Add("@SoLuong", SqlDbType.Int).Value = SoLuong;
sqlCmd.Parameters.Add("@ChiTiet", SqlDbType.NVarChar, 1000).Value = ChiTiet;
sqlCmd.Parameters.Add("@Bak1", SqlDbType.Int).Value = Bak1;
sqlCmd.Parameters.Add("@Bak2", SqlDbType.Bit).Value = Bak2;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例2: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, string TieuDe, string NoiDung, string TomTat, int? NguoiDungID,
DateTime? NgayCapNhat, string Anh, int? LoaiTinTuc)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsTinTuc";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@TieuDe", SqlDbType.NVarChar, 200).Value = TieuDe;
sqlCmd.Parameters.Add("@NoiDung", SqlDbType.NText).Value = NoiDung;
sqlCmd.Parameters.Add("@TomTat", SqlDbType.NText).Value = TomTat;
sqlCmd.Parameters.Add("@NguoiDungID", SqlDbType.Int).Value = NguoiDungID;
sqlCmd.Parameters.Add("@NgayCapNhat", SqlDbType.DateTime).Value = NgayCapNhat;
sqlCmd.Parameters.Add("@Anh", SqlDbType.VarChar, 100).Value = Anh;
sqlCmd.Parameters.Add("@LoaiTinTuc", SqlDbType.Int).Value = LoaiTinTuc;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例3: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? SanPhamID, string DuongDan, string Bak1, string Bak2,
int? Bak3, int? SanPhamMauID)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsAnh";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@SanPhamID", SqlDbType.Int).Value = SanPhamID;
sqlCmd.Parameters.Add("@DuongDan", SqlDbType.NVarChar, 100).Value = DuongDan;
sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;
sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;
sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;
sqlCmd.Parameters.Add("@SanPhamMauID", SqlDbType.Int).Value = SanPhamMauID;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例4: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? DonHangID, int? SanPhamID, string TenSanPham,
decimal? GiaSanPham, int? SoLuong, decimal? TongTien, int? CuaHangID,
string TenCuaHang)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsChiTietDonHang";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@DonHangID", SqlDbType.Int).Value = DonHangID;
sqlCmd.Parameters.Add("@SanPhamID", SqlDbType.Int).Value = SanPhamID;
sqlCmd.Parameters.Add("@TenSanPham", SqlDbType.NVarChar, 50).Value = TenSanPham;
sqlCmd.Parameters.Add("@GiaSanPham", SqlDbType.Money).Value = GiaSanPham;
sqlCmd.Parameters.Add("@SoLuong", SqlDbType.Int).Value = SoLuong;
sqlCmd.Parameters.Add("@TongTien", SqlDbType.Money).Value = TongTien;
sqlCmd.Parameters.Add("@CuaHangID", SqlDbType.Int).Value = CuaHangID;
sqlCmd.Parameters.Add("@TenCuaHang", SqlDbType.NVarChar, 100).Value = TenCuaHang;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例5: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? CuaHangID, string TenHoTro, string YM, string HoVaTen,
string DienThoai, string email)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsHoTroTrucTuyen";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@CuaHangID", SqlDbType.Int).Value = CuaHangID;
sqlCmd.Parameters.Add("@TenHoTro", SqlDbType.NVarChar, 100).Value = TenHoTro;
sqlCmd.Parameters.Add("@YM", SqlDbType.VarChar, 100).Value = YM;
sqlCmd.Parameters.Add("@HoVaTen", SqlDbType.NVarChar, 100).Value = HoVaTen;
sqlCmd.Parameters.Add("@DienThoai", SqlDbType.VarChar, 20).Value = DienThoai;
sqlCmd.Parameters.Add("@email", SqlDbType.VarChar, 100).Value = email;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例6: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? NguoiDungID, int? DauGiaID, decimal? TraGia,
DateTime? ThoiGianTraGia, string Bak1, string Bak2, int? Bak3, bool? Bak4)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsTraGia";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@NguoiDungID", SqlDbType.Int).Value = NguoiDungID;
sqlCmd.Parameters.Add("@DauGiaID", SqlDbType.Int).Value = DauGiaID;
sqlCmd.Parameters.Add("@TraGia", SqlDbType.Money).Value = TraGia;
sqlCmd.Parameters.Add("@ThoiGianTraGia", SqlDbType.DateTime).Value = ThoiGianTraGia;
sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;
sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;
sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;
sqlCmd.Parameters.Add("@Bak4", SqlDbType.Bit).Value = Bak4;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例7: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, string LoaiNguoiDung, int? SapXep, string Bak1, string Bak2,
int? Bak3)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsLoaiNguoiDung";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@LoaiNguoiDung", SqlDbType.NVarChar, 50).Value = LoaiNguoiDung;
sqlCmd.Parameters.Add("@SapXep", SqlDbType.Int).Value = SapXep;
sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;
sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;
sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例8: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? NguoiDungID, string HovaTenNguoiNhan, string DiaChiNguoiNhan,
string EmailNguoiNhan, string DTDDNguoiNhan, string CMTND)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsDonHang";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@NguoiDungID", SqlDbType.Int).Value = NguoiDungID;
sqlCmd.Parameters.Add("@HovaTenNguoiNhan", SqlDbType.NVarChar, 50).Value = HovaTenNguoiNhan;
sqlCmd.Parameters.Add("@DiaChiNguoiNhan", SqlDbType.NVarChar, 1000).Value = DiaChiNguoiNhan;
sqlCmd.Parameters.Add("@EmailNguoiNhan", SqlDbType.NVarChar, 50).Value = EmailNguoiNhan;
sqlCmd.Parameters.Add("@DTDDNguoiNhan", SqlDbType.NVarChar, 50).Value = DTDDNguoiNhan;
sqlCmd.Parameters.Add("@CMTND", SqlDbType.VarChar, 9).Value = CMTND;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例9: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, int? QuangCaoID, int? ViTriQuangCao, int? NhomSanPhamID,
int? khuvucid, int? bak)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsViTriQuangCao";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@QuangCaoID", SqlDbType.Int).Value = QuangCaoID;
sqlCmd.Parameters.Add("@ViTriQuangCao", SqlDbType.Int).Value = ViTriQuangCao;
sqlCmd.Parameters.Add("@NhomSanPhamID", SqlDbType.Int).Value = NhomSanPhamID;
sqlCmd.Parameters.Add("@khuvucid", SqlDbType.Int).Value = khuvucid;
sqlCmd.Parameters.Add("@bak", SqlDbType.Int).Value = bak;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例10: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, string TenKhuVuc, string GhiChu, int? SapXep, bool? HienThi,
string Bak1, string Bak2, int? Bak3)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsKhuVuc";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@TenKhuVuc", SqlDbType.NVarChar, 50).Value = TenKhuVuc;
sqlCmd.Parameters.Add("@GhiChu", SqlDbType.NVarChar, 1000).Value = GhiChu;
sqlCmd.Parameters.Add("@SapXep", SqlDbType.Int).Value = SapXep;
sqlCmd.Parameters.Add("@HienThi", SqlDbType.Bit).Value = HienThi;
sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;
sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;
sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例11: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, string TenHangSanXuat, string ThongTin, int? SapXep, string Bak1,
string Bak2, int? Bak3)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsHangSanXuat";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@TenHangSanXuat", SqlDbType.NVarChar, 50).Value = TenHangSanXuat;
sqlCmd.Parameters.Add("@ThongTin", SqlDbType.NVarChar, 4000).Value = ThongTin;
sqlCmd.Parameters.Add("@SapXep", SqlDbType.Int).Value = SapXep;
sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;
sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;
sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例12: CountSanPhamByMaSo
public int CountSanPhamByMaSo(string strDate)
{
DataAccess objDataAccess = new DataAccess();
int intResult = 0;
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "_CountSanPhamByMaSo";
sqlCmd.Parameters.Add("@Str", SqlDbType.VarChar).Value = strDate;
intResult = objDataAccess.ExecuteScalar(sqlCmd);
return intResult;
}
}
示例13: Insert
public int Insert(string NoiDung)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "InsertCauHinhHeThong";
sqlCmd.Parameters.Add("@NoiDung", SqlDbType.NVarChar, 1000).Value = NoiDung;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例14: Insert
public int Insert(string TenDongSanPham)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "InsertDongSanPham";
sqlCmd.Parameters.Add("@TenDongSanPham", SqlDbType.NVarChar, 100).Value = TenDongSanPham;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}
示例15: CopyAndUpdateFields
public int CopyAndUpdateFields(int SourceID, string NoiDung)
{
DataAccess objDataAccess = new DataAccess();
using (SqlCommand sqlCmd = new SqlCommand())
{
int iID = 0;
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "CopyAndUpdateFieldsCauHinhHeThong";
sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
sqlCmd.Parameters.Add("@NoiDung", SqlDbType.NVarChar, 1000).Value = NoiDung;
iID = objDataAccess.ExecuteScalar(sqlCmd);
return iID;
}
}