当前位置: 首页>>代码示例>>C#>>正文


C# DataAccess.ExecuteQuery方法代码示例

本文整理汇总了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";
        }
    }
开发者ID:dsbissett,项目名称:chonet,代码行数:31,代码来源:RunScript.aspx.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:Base_ViTriQuangCao.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:Base_LoaiNguoiDung.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:ThuocTinhSanPham.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:Base_HangSanXuat.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:Base_NhaCungCap.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:Base_ThuocTinh.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:11,代码来源:Base_CauHinhHeThong.cs

示例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");
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:12,代码来源:CuaHangNhomSanPham.cs

示例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;
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:12,代码来源:NguoiDung.cs

示例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;
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:13,代码来源:NhomSanPham.cs

示例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;
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:13,代码来源:TinTuc.cs

示例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;
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:13,代码来源:Anh.cs

示例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;
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:14,代码来源:CuaHang.cs

示例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;
     }
 }
开发者ID:dsbissett,项目名称:chonet,代码行数:14,代码来源:TinTuc.cs


注:本文中的DataAccess.ExecuteQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。