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
相关文档:
下载页面:
------------------------------------------------------------------------------
download.ashx
using System;
using System.Web;
public ......
1、DateTime 数字型
System.DateTime currentTime=new System.DateTime();
1.1 取当前年月日时分秒
currentTime=System.DateTime.Now;
1.2 取当前年
int 年=currentTime.Year;
1.3 取当前月 &n ......
MySQL FOR LINUX
先检查系统是否装上了mysql,如果有将其卸载掉
rpm -qa | grep mysql
注意mysql的大小写,大小写都有可能
rpm -e --nodeps mysql*
一定要用--nodeps卸载,不检查依赖性关系。
创建用户mysql
groupadd mysql
useradd -g mysql mysql
passwd mysql
在/usr/local下建立 mysql 文件夹
然后将安装� ......
登陆以后运行以下命令,给予远程访问客户端权限..
grant all on *.* to 'remote'@'172.16.21.39' identified by 'password';
remote表示用户名.
'172.16.21.39' 远程ip地址
password表示远程登陆密码.
默认状况下,出于安全考虑,mysql数据库屏蔽了远程访问功能。 然而在许多状况下,你需要在家
或者从web程序去访问 ......