aspnet调用mysql存储过程
来源:互联网 发布:淘宝装修设计教程 编辑:程序博客网 时间:2024/06/11 18:27
{
DataTable reuslt = new DataTable();
using (MySqlConnection conn = new MySqlConnection(connectionString))
{
if (conn.State == ConnectionState.Closed)
conn.Open();
MySqlDataAdapter sda = new MySqlDataAdapter("CommonPagenation", conn);
sda.SelectCommand.CommandType = CommandType.StoredProcedure;
MySqlParameter[] param = new MySqlParameter[8];
param[0] = new MySqlParameter("?tableName", tableName);
param[1] = new MySqlParameter("?selectWhere", selectWhere);
param[2] = new MySqlParameter("?selectID", selectID);
param[3] = new MySqlParameter("?selectOrder", selectOrder);
param[4] = new MySqlParameter("?pageNo", pageNo);
param[5] = new MySqlParameter("?pageSize", pageSize);
param[6] = new MySqlParameter("?_totalcount",MySqlDbType.Int32);
param[6].Direction = ParameterDirection.Output;
param[7] = new MySqlParameter("?_pagecount", MySqlDbType.Int32);
param[7].Direction = ParameterDirection.Output;
sda.SelectCommand.Parameters.AddRange(param);
sda.Fill(reuslt);
totalcount = Convert.ToInt32(param[6].Value);
pagecount = Convert.ToInt32(param[7].Value);
}
return reuslt;
}
前台我是用的aspnetpager,非常好用的分页工具
<webdiyer:AspNetPager ID="ItemPaging" runat="server"
CustomInfoSectionWidth="30%" PageSize="20" FirstPageText="首页"
LastPageText="最后一页" NextPageText="下一页" PrevPageText="上一页"
ShowCustomInfoSection="Left" CenterCurrentPageButton="True" LayoutType="Table"
ShowPageIndexBox="Never" OnPageChanging="ItemPaging_PageChanging">
</webdiyer:AspNetPager>
调用::
DataTable table = DbHelperMySql.CommonPagenation("dede_archives", " typeid="+typeid, "", " dates desc ", ItemPaging.CurrentPageIndex, ItemPaging.PageSize,out totalcount,out pagecount);
ItemPaging.RecordCount = totalcount;
ItemPaging.AlwaysShow = true;
ItemPaging.CustomInfoHTML = "总计<font color='blue'><b>" + ItemPaging.RecordCount.ToString() + "</b></font>条,";
ItemPaging.CustomInfoHTML += "当前为第<font color='red'><b>" + ItemPaging.CurrentPageIndex.ToString() + "</b></font>页,";
ItemPaging.CustomInfoHTML += "共<font color='blue'><b>" + ItemPaging.PageCount.ToString() + "</b></font>页";
- aspnet调用mysql存储过程
- aspnet调用sqlserver分页存储过程
- mysql存储过程调用
- MySQL++调用存储过程
- 调用mysql存储过程
- mysql 调用存储过程
- MySQL调用存储过程
- PHP调用MySQL存储过程
- php调用mysql 存储过程
- ibatis 调用mysql 存储过程
- mysql event调用存储过程
- JAVA调用MYSQL存储过程
- MySQL存储过程相互调用
- MySQL存储过程递归调用
- mysql多次调用存储过程
- C#调用MySQL存储过程
- mysql存储过程及调用
- Spring调用MySql存储过程
- Same Tree 判断两棵树是不是相同
- Spring框架的 IoC和AOP
- Warning: No such file or directory in D:\WWW\XXX\vendor\composer\autoload_real.ph
- 乱码问题解决
- Android Studio查找有中文字符的文件位置
- aspnet调用mysql存储过程
- I,P,B帧和PTS,DTS的关系
- Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple
- C#利用ODP.NET往oracle中高效插入百万数据
- post请求
- zip压缩 中文乱码解决方法
- 使用异步 I/O 大大提高应用程序的性能
- Android用代码判断是否在使用VPN
- linux screen命令详解