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

C#²Ù×÷¸÷ÖÖÖ´ÐÐsqlµÄ·½·¨º¬´æ´¢¹ý³Ì²Ù×÷

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
namespace MyDbTest
{
class Program
{
static void Main(string[] args)
{
SqlConnection thisConnection = new SqlConnection(
@"Data Source=localhost;Initial Catalog=CSGL;Persist Security Info=True;User ID=test;Password=test");
thisConnection.Open();
SqlCommand myCommand = new SqlCommand("P_Test", thisConnection);
myCommand.CommandType = CommandType.StoredProcedure;
//Ìí¼ÓÊäÈë²éѯ²ÎÊý¡¢¸³ÓèÖµ
myCommand.Parameters.Add("@id", SqlDbType.Int);
myCommand.Parameters["@id"].Value = "120";
//Ìí¼ÓÊä³ö²ÎÊý
myCommand.Parameters.Add("@Rowcount", SqlDbType.Int);
myCommand.Parameters["@Rowcount"].Direction = ParameterDirection.Output;
myCommand.ExecuteNonQuery();
//µÃµ½´æ´¢¹ý³ÌÊä³ö²ÎÊý
Console.WriteLine(" ´æ´¢¹ý³ÌµÄ²ÎÊý"+ myCommand.Parameters["@Rowcount"].Value.ToString());
thisConnection.Close();
Console.ReadLine();

//SqlCommand thisCommand = thisConnection.CreateCommand();
//thisCommand.CommandText = "select count(*) from stu";
////ExecuteScalar£ºÖ´ÐÐÖ»·µ»ØÒ»¸öÖµµÄSQLÃüÁî¡£
//object countResult = thisCommand.ExecuteScalar();
//Console.WriteLine("Count of Customers={0}", countResult);
//thisConnection.Close();
//Console.ReadLine();

//SqlCommand thisCommand = thisConnection.CreateCommand();
//thisCommand.CommandText = "update stu set snm='haha' where id=120";
////Inset,Update,DelelteµÄÊý¾ÝÐ޸IJÙ×÷Ò²²»·µ»ØÈκÎÊý¾Ý£¬
////ÎÒÃǶÔÕâЩÃüÁî¸ÐÐËȤµÄÊÇÐ޸IJÙ×÷Ó°ÏìµÄÐÐÊý£¬¿ÉÒÔÓÃExecuteNonQuery()·½·¨
//int rowsAffected = thisCommand.ExecuteNonQuery();
//Console.WriteLine("Rows Updated={0}", rowsAffected);
//thisConnection.


Ïà¹ØÎĵµ£º

ÈçºÎÓÃSQL Óï¾ä¶ÁÈ¡DÅÌÄÚÈÝ

master..xp_dirtree   'D:\',1,1        µÚÒ»¸ö1ÊÇÉî¶È£¬µÚ¶þ¸ö1ÊÇÎļþ
1.   Ö´ÐÐ   master..xp_dirtree   'c:\',1,1,ÕâÑù¿ÉÒÔ»ñÈ¡c:\ϵÄËùÓÐÎļþºÍÎļþ¼Ð,²»°üÀ¨×ÓÎļþ¼Ð¼°Îļþ   
   
2.   ÏÔʾÔÚtreeviewÖÐ,ÓñêÖ ......

c#ÖеÄAjaxÉÏÊÖƪ£­£­£­·Çͬ²½ÇëÇóresponseXML

ÎÒÃÇ¿ÉÒÔʹÓÃXML×÷ΪÊý¾Ý´«ËÍ¡¢¹µÍ¨µÄ¸ñʽ£¬Ajax¿Í»§¶ËÈôÒª·¢ËÍXML£¬»ù±¾ÉϾÍÊǽ«XML×÷Ϊ×Ö·û´®£¬ÔÚPOSTÇëÇóʱ·¢ËÍ£¬ÀýÈ磺
*HelloAjax.js
view plaincopy to clipboardprint?
var xmlHttp;  
function createXMLHttpRequest() {  
    if (window.XMLHttpRequest) {   ......

C# XmlÖÐÓ³ÉäΪÀàÊý¾Ý½á¹¹£¨±¨ÎÄ£©

        [System.Runtime.Serialization.DataMemberAttribute()]
        public Information Archive {
            get {
         &n ......

SQL ServerÊý¾Ý¿â¹ÜÀí³£ÓÃSQLºÍT SQLÓï¾ä

1.²é¿´Êý¾Ý¿âµÄ°æ±¾
select @@version
2.²é¿´Êý¾Ý¿âËùÔÚ»úÆ÷²Ù×÷ϵͳ²ÎÊý
exec master..xp_msver
3.²é¿´Êý¾Ý¿âÆô¶¯µÄ²ÎÊý
sp_configure
4.²é¿´Êý¾Ý¿âÆô¶¯Ê±¼ä
select convert(varchar(30),login_time,120) from master..sysprocesses where spid=1
²é¿´Êý¾Ý¿â·þÎñÆ÷ÃûºÍʵÀýÃû
print ''Server Name...... ......

sql·þÎñÆ÷°²È«¼Ó¹Ì

5.1 ÃÜÂë²ßÂÔ
¡¡¡¡ÓÉÓÚsql server²»Äܸü¸ÄsaÓû§Ãû³Æ£¬Ò²²»ÄÜɾ³ýÕâ¸ö³¬¼¶Óû§£¬ËùÒÔ£¬ÎÒÃDZØÐë¶ÔÕâ¸öÕʺŽøÐÐ×îÇ¿µÄ±£»¤£¬µ±È»£¬°üÀ¨Ê¹ÓÃÒ»¸ö·Ç³£Ç¿×³µÄÃÜÂ룬×îºÃ²»ÒªÔÚÊý¾Ý¿âÓ¦ÓÃÖÐʹÓÃsaÕʺš£Ð½¨Á¢Ò»¸öÓµÓÐÓësaÒ»ÑùȨÏ޵ij¬¼¶Óû§À´¹ÜÀíÊý¾Ý¿â¡£Í¬Ê±Ñø³É¶¨ÆÚÐÞ¸ÄÃÜÂëµÄºÃÏ°¹ß¡£Êý¾Ý¿â¹ÜÀíÔ±Ó¦¸Ã¶¨Æڲ鿴ÊÇ·ñÓв»·ûºÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ