sqlÁ¬½Ó´úÂë
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Data.SqlClient;
namespace WebApplication1
{
public class Message
{
public static IList<MessageInfo> GetMessages()
{
IList<MessageInfo> msgs = new List<MessageInfo>();//×Ô¶¨ÒåÁôÑÔʵÌåµÄ¼¯ºÏ
//´ÓÅäÖÃÎļþÖлñÈ¡Á¬½Ó×Ö·û´®
string connstr = WebConfigurationManager.ConnectionStrings["GuestBookDBConnectionString"].ConnectionString;
//´´½¨Á¬½Ó¶ÔÏó
SqlConnection conn = new SqlConnection(connstr);
//´´½¨ÃüÁî¶ÔÏó
SqlCommand cmd = new SqlCommand("select * from MsgInfo", conn);
//´ò¿ªÊý¾Ý¿âÁ¬½Ó
conn.Open();
//Ö´ÐÐÃüÁî¶ÔÏóÖеÄsqlÃüÁ»ñÈ¡Êý¾Ý
//×¢ÒâdatareaderµÄÌص㣬ֻ¶Á£¬ÏòÇ°£¬Ã¿´ÎÒ»Ìõ¼Ç¼¡£
SqlDataReader dr = cmd.ExecuteReader();
//Ñ»·¶ÁÈ¡Êý¾Ý¿â¼Ç¼£¬Ã¿´ÎÒ»ÐÐ
while (dr.Read())
{
 
Ïà¹ØÎĵµ£º
ת×Ô
http://topic.csdn.net/t/20050110/09/3711952.html
accessÖÐʱ¼äÒªÓÃ#,²»ÊÇË«ÒýºÅ
select * from kc where rq < #2000-01-01# and rq>#2002-01-01#
²»ÒªÓÃbetween,ËüµÄЧÂÊÌ©µÍ
ʹÓÃ# ¶ø²»ÊÇ ......
½ñÈÕ²úÆ·²¿Òªµ¼ÅúÊý¾Ý£¬µ«ÊÇÐèÒªÁ¬½Ó²éѯ²éѯµÄ¼¸¸ö±í²»ÔÚͬһ·þÎñÆ÷ÉÏ¡£ËùÒÔÎÒ¿ªÊ¼ÊÇÕâô¸ÉµÄ£º
1.²éѯһ̨·þÎñÆ÷µÄÊý¾Ý£¬²¢µ¼Èë±¾µØExcel
2.²éѯÁíһ̨·þÎñÆ÷µÄÊý¾Ý£¬²¢µ¼Èë±¾µØExcel
3.Excleµ¼ÈëÊý¾Ý¿â£¬Êý¾Ý¿â×Ô´øÁËExcelµ¼ÈëÊý¾Ý¿âµÄ¹¦ÄÜ
4.Á¬½Ó²éѯ£¬OVER£¡
ºóÀ´²ÅÖªµÀ²úÆ·²¿ÒªÈ«¹ú50¶à¸ö³ÇÊеÄÊý¾Ý£¬ËùÒÔÿ¸ö³Ç ......
1¡¢ÊµÏÖÐÐÁж¯Ì¬×ª»»£¬³£ÓÃÓÚÖ÷´Ó±í¹ØÁªÊ±µÄÌØÊâÐèÇó
select rwbm,psqh,
max(decode(xh1,1,yy))JKYL1,
max(decode(xh1,2,yy))JKYL2,
&n ......
½ñÌì´ÓÊý¾Ý¿âÖвéѯ³öxml£¬Í¬Ê±Ìí¼ÓÒ»¸ö¸ù½Úµã
×öÁËÈçϲâÊÔ£º
create table TestXmlQuery(
ID int identity(1,1) not null,
Name varchar(10)
)
go
insert into [TestXmlQuery] (Name) values('²âÊÔ1')
insert into [TestXmlQuery] (Name) values('²âÊÔ2')
insert into [TestXmlQuery] (Name) values('²âÊÔ3')
......
1 Âß¼Êý¾Ý¿âºÍ±íµÄÉè¼Æ
Êý¾Ý¿âµÄÂß¼Éè¼Æ¡¢°üÀ¨±íÓë±íÖ®¼äµÄ¹ØϵÊÇÓÅ»¯¹ØϵÐÍÊý¾Ý¿âÐÔÄܵĺËÐÄ¡£Ò»¸öºÃµÄÂß¼Êý¾Ý¿âÉè¼Æ¿ÉÒÔΪ
ÓÅ»¯Êý¾Ý¿âºÍÓ¦ÓóÌÐò´òÏÂÁ¼ºÃµÄ»ù´¡¡£
±ê×¼»¯µÄÊý¾Ý¿âÂß¼Éè¼Æ°üÀ¨ÓöàµÄ¡¢ÓÐÏ໥¹ØϵµÄÕ±íÀ´´úÌæºÜ¶àÁеij¤Êý¾Ý±í¡£ÏÂÃæÊÇһЩʹÓñê×¼»¯
±íµÄһЩºÃ´¦¡£
A:ÓÉÓÚ±íÕ£¬Òò´Ë¿ÉÒÔʹŠ......