ÓÃC#¶ÁSQL SERVERµ½¿ØÖÆ̨µÄ¼òµ¥Ê¾Àý
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
//sqlserverÉí·ÝÑéÖ¤
//string sqlconn = "server=(local);database=keede1228;user id=sa;password=123;";
//windowsÉí·ÝÑéÖ¤
string sqlconn = "server=(local);database=keede1228;integrated security=SSPI;";
string select = "select * from dbo.lmShop_City";
SqlConnection conn = new SqlConnection(sqlconn);
Console.WriteLine("33");
conn.Open();
Console.WriteLine("11");
SqlCommand cmd = new SqlCommand(select, conn);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Console.WriteLine("cityid:{0} city:{1} area:{2}", reader[0], reader[1], reader[2]);
}
conn.Close();
Console.WriteLine("22");
Console.ReadKey();
}
}
}
ÓÐÒ»µãÒÉÎÊ£º×îºóÊä³öµ½¿ØÖÆ̨µÄʱºò£¬Èç¹û²»¼Ó"cityid:{0} city:{1} area:{2}"¾Í»á±¨´í£¬²»ÖªµÀÊÇΪʲô£¬ºÃÏñÊÇÀàÐÍת»»µÄÊ£¬ÓÐÃ÷°×µÄ°ïÎÒ½â´ðһϣ¬Ð»Ð»¡£
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
ʲôÊÇÅÅÐò¹æÔò£¨collation£©
¹ØÓÚSQL ServerµÄÅÅÐò¹æÔò£¬¹À¼Æ´ó¼Ò¶¼²»Ä°Éú£¬ÔÚ´´½¨Êý¾Ý¿âʱÎÒÃǾ³£ÒªÑ¡ÔñÒ»ÖÖÅÅÐò¹æÔò£¨conllation£©£¬Ò»°ãÎÒÃÇ»áÁôÒ⵽ÿһÖÖÓïÑÔµÄÅÅÐò¹æÔò¶¼ÓÐÐí¶àÖÖ£¬±ÈÈç±ê×¼´ó½¼òÌåÖÐÎÄChinese_PRCµÄÅÅÐò¹æÔò¾ÍÓÐÊýÊ®ÖÖÖ®¶à
ÕâЩÅÅÐò¹æÔòÓÐʲô×÷ÓÃÄØ£¿ÈÃÎÒÃÇÏÈÀ´¿´¿´MS¹Ù·½µÄ½âÊÍ£º
ÅÅÐò¹æÔ ......
http://topic.csdn.net/u/20100113/17/b52a1ef4-54a8-4333-8119-a161869c1eef.html
---------------------------------
-- Author: liangCK СÁº
-- Title : ²éÿ¸ö·Ö×éÇ°NÌõ¼Ç¼
-- Date : 2008-11-13 17:19:23
---------------------------------
--> Éú³É²âÊÔÊý¾Ý: #T
IF OBJECT_ID(' ......
create or replace view pxfy_view as
select t1.form_id,t1.reserve as mid,t1.feiyong,t.cjpxr_name as full_name,1 as pxlx,t1.topic,t1.identity,
t1.begin_time as CREATEDATE,t1.end_time as completedate,pv.city,pv.DEPT_ID
from wf_oa_pxnb_cjry t,WF_OA_PX ......
SQL ServerÊý¾ÝÀàÐÍ2009Äê02ÔÂ02ÈÕ ÐÇÆÚÒ» 11:20Êý¾ÝÀàÐÍÊÇÊý¾ÝµÄÒ»ÖÖÊôÐÔ£¬ÊÇÊý¾ÝËù±íʾÐÅÏ¢µÄÀàÐÍ¡£ÈκÎÒ»ÖÖÓïÑÔ¶¼ÓÐËü×Ô¼ºËù¹ÌÓеÄÊý¾ÝÀàÐÍ£¬SQL ServerÌṩһÏÂ25ÖÖ¹ÌÓеÄÊý¾ÝÀàÐÍ¡£ SQL ServerÊý¾ÝÀàÐÍÒ»ÀÀ±í
¡¡¡¡·Binary [(n)]
·Varbinary [(n)]
·Char [(n)]
·Varchar[(n)]
· ......