Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#Á¬½ÓMySQLÊý¾Ý¿â·½·¨

C#Á¬½ÓMySQLÊý¾Ý¿â·½·¨
1¡¢ÓÃMySQLDriverCSÁ¬½ÓMySQLÊý¾Ý¿âÏÈÏÂÔغͰ²×°MySQLDriverCS£¬µØÖ·£º
http://sourceforge.net/projects/mysqldrivercs
ÔÚ°²×°Îļþ¼ÐÏÂÃæÕÒµ½MySQLDriver.dll£¬È»ºó½«MySQLDriver.dllÌí¼ÓÒýÓõ½ÏîÄ¿ÖÐ
×¢£ºÎÒÏÂÔصÄÊÇ°æ±¾ÊÇ MySQLDriverCS-n-EasyQueryTools-4.0.1-DotNet2.0.exe
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Odbc;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySQLDriverCS;
namespace mysql
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            MySQLConnection conn = null;
            conn = new MySQLConnection(new MySQLConnectionString("localhost", "inv", "root", "831025").AsString);
            conn.Open();
            MySQLCommand commn = new MySQLCommand("set names gb2312", conn);
            commn.ExecuteNonQuery();
            string sql = "select * from exchange ";
            MySQLDataAdapter mda = new MySQLDataAdapter(sql, conn);
            DataSet ds = new DataSet();
            mda.Fill(ds, "table1");


Ïà¹ØÎĵµ£º

½«ÈÕÖ¾ÎļþдÈëMySqLÖÐ

Ê×ÏȽ¨Ò»¸ö¹¤³Ì£¬×¼±¸ºÃlog4jµÄjar°üºÍMysqLµÄÇý¶¯°ü¡£
ÅäÖÃlog4j.propertiesÎļþ£º
    #´Ë¾äΪ¶¨ÒåÃûΪstdoutµÄÊä³ö¶ËÊÇÄÄÖÖÀàÐÍ£¬¿ÉÒÔÊÇ
#org.apache.log4j.ConsoleAppender£¨¿ØÖÆ̨£©£¬
#org.apache.log4j.FileAppender£¨Îļþ£©£¬
#org.apache.log4j.DailyRollingFileAppender£¨Ã¿Ìì²úÉúÒ»¸öÈÕÖ¾ÎÄ ......

SQL SERVERÊý¾ÝÀàÐÍÓëC#Êý¾ÝÀàÐͶÔÕÕ±í

bigint ´Ó -2^63 (-9223372036854775808) µ½ 2^63-1 (9223372036854775807) µÄÕûÐÍÊý¾Ý£¨ËùÓÐÊý×Ö£©¡£´æ´¢´óСΪ 8 ¸ö×Ö½Ú¡£ Int64
int ´Ó -2^31 (-2,147,483,648) µ½ 2^31 - 1 (2,147,483,647) µÄÕûÐÍÊý¾Ý£¨ËùÓÐÊý×Ö£©¡£´æ´¢´óСΪ 4 ¸ö×Ö½Ú¡£int µÄ SQL-92 ͬÒå×ÖΪ integer¡£ Int32
smallint ´Ó -2^15 (-32,768) µ½ ......

IBatisNet SQL ServerµÄfloatÀàÐÍת»»Îªc# float³ö´í

½ñÌìдһ¸öÉÌÆ·µÄÐ޸ŦÄÜʱÓöµ½µÄÎÊÌâ
ÉÌÆ·ÖÐÖØÁ¿ weight µÄÊý¾Ý¿â(SQL Server2005)ÀàÐͶ¨ÒåΪ float
ÔÚmappings ÖÐת»»Îªc#ÀàÐ͵ÄÒ»¾äΪ
<result property="Goods_Weight" column="Goods_Weight" type="float" dbType="float"/>
°´Àí˵Õâ¸ö float ÊÇÒ»ÑùµÄ£¬×ª»»ÍêÈ«²»»á³öÏÖÎÊÌ⣬
ʵ¼Ê³ÌÐòÔËÐÐʱ£¬ÏµÍ³±¨´í ......

oracleºÍmysqlÈÕÆÚº¯Êý¶Ô±È

MySQLÈÕÆÚ×ֶηÖDateºÍTimeÁ½ÖÖ£¬oracleÈÕÆÚ×Ö¶ÎÖ»ÓÐDate£¬°üº¬ÄêÔÂÈÕʱ·ÖÃëÐÅÏ¢£¬Óõ±Ç°Êý¾Ý¿âµÄϵͳʱ¼äΪsysdate,¾«È·µ½Ã룬»òÕßÓÃ×Ö·û´®×ª»»ÈÕÆÚÐͺ¯Êý£º
 
    To_date('2001-08-01','YYYY-MM-DD'); Äê-ÔÂ-ÈÕ
    24Сʱ£º·ÖÖÓ£ºÃëµÄ¸ñʽ  'YYYY-MM-DD HH24:MI:SS'  ......

ÕûºÏfreeBSDÏÂnginx+php+mysql°²×°·½°¸£¨ports°²×°£©

  ×î½üÒ»Ö±ÔÚÑо¿freeBSDÏÂnginx+php+mysqlµÄ°²×°£¬¿´Á˺ܶàÍøÉϵÄ×ÊÁÏÊÕ»ñ²»Ð¡£¬²»¹ý´ó²¿·Ö¶¼ÊDZàÒë°²×°£¬Ïà¶Ô³õѧÕßÀ´Ëµ±È½Ï¸´ÔÓ£¬²»ÈÝÒ×Àí½â£¬ËùÒÔÎÒÕûºÏÁËһЩports°²×°µÄ×ÊÁÏ£¬¶¼ÊǾ­¹ý×Ô¼ºÑéÖ¤ºóµÄ£¬°²×°³É¹¦Ò²±È½ÏÈÝÒ×Àí½â£¬ÏÂÃæÊÇÁ½Öֳɹ¦µÄ°¸Àý£¬ÆäÖÐÓÐÒ»¸öÊÇApache´úÌænginxµÄ°²×°£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ