本文整理汇总了C#中DataService.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# DataService.ExecuteScalar方法的具体用法?C# DataService.ExecuteScalar怎么用?C# DataService.ExecuteScalar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataService
的用法示例。
在下文中一共展示了DataService.ExecuteScalar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LaySoPhieuTruoc
public static int LaySoPhieuTruoc(int maLoaiPhieu)
{
DataService dS = new DataService();
SqlCommand cmd = new SqlCommand("SELECT TOP 1 SoPhieuTruoc FROM LoaiPhieu WHERE MaLoaiPhieu = @maLoaiPhieu");
cmd.Parameters.Add("maLoaiPhieu", SqlDbType.Int).Value = maLoaiPhieu;
return (int)dS.ExecuteScalar(cmd);
}
示例2: LayThoiDiemSaoLuuTiepTheo
public static DateTime LayThoiDiemSaoLuuTiepTheo()
{
DataService dS = new DataService();
SqlCommand cmd = new SqlCommand("SELECT TOP 1 ThoiDiemSaoLuuTiepTheo FROM QuyDinh");
return (DateTime)dS.ExecuteScalar(cmd);
}
示例3: LayViTriSaoLuuMacDinh
public static String LayViTriSaoLuuMacDinh()
{
DataService dS = new DataService();
SqlCommand cmd = new SqlCommand("SELECT TOP 1 ViTriSaoLuu FROM QuyDinh");
return dS.ExecuteScalar(cmd).ToString();
}
示例4: LayTaiKhoanCo
public static Int64 LayTaiKhoanCo()
{
DataService m_QuyDinhData = new DataService();
SqlCommand cmd = new SqlCommand("SELECT TOP 1 TaiKhoanCo FROM QUYDINH");
return Convert.ToInt64(m_QuyDinhData.ExecuteScalar(cmd));
}