MySQL(asp.net) 事务
try
{
string _conStr = "Driver={MySQL ODBC 3.51
Driver};server=localhost;database=test;uid=test;password=1;option=3";
OdbcConnection _odbcCon = new OdbcConnection(_conStr);
_odbcCon.Open();
OdbcTransaction trans = _odbcCon.BeginTransaction
(IsolationLevel.ReadCommitted);
OdbcCommand cmd = new OdbcCommand();
cmd.Connection = trans.Connection;
cmd.Transaction = trans;
string _sqlStr = "";
try
{
_sqlStr = "update test ....."
cmd.CommandText = _sqlStr;
cmd.ExecuteNonQuery();
_sqlStr = "";
}
catch
{
&n
相关文档:
1.弹出对话框.
a. 弹出对话框:
C# codeClientScript.RegisterStartupScript(this.GetType(), "",
"<script>window.alert('该会员没有提交申请,请重新提交!')</script>");
b.转向指定页面
C# code Response.Write("
<script>window.location='http://www. ......
今天搭建mysql数据库,连接了半天,都提示10061错误,以为密码出了问题试了半天,压根连服务都连接不上,忙活了半个多小时,才发现是系统补丁打了之后出现的问题(kb967723)
于是网上找了一下资料
最近一个客户服务器的MYSQL频繁提示连接不上,修改了MYSQL的最大连接数还是这样,于是开始问万能的搜索引擎大人!终于在微软找到了 ......
方法一:
新建一个页面然后在页面拖一个GridView控件在属性框中设置GridView控件的AllowPaing属性为True 然后再设置GridView的PageSize属性,源文件如下:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames ="classId" CellPadding="5" OnRowDeleting="GridView1_RowDeleting" All ......
今天给客户做了个功能需要把网格数据(Gridview)导出成Execl,所以我去网上找了个代码 private void Export(string FileType, string FileName)
...{
try
...{
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "att ......
同样是一篇转帖的文章,
原文: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html
着重介绍了ASP.NET MVC2 里面的 ModelMetadata 类
ASP.NET MVC 2 Templates, Part 2: ModelMetadata
Series Index
Part 1: Introduction
Part 2: ModelMetadata
Understanding You ......