连接什么数据库?看看这些已经问过的问题。
http://expert.csdn.net/Expert/ForumList_Search.asp?searchtype=2&bigclassid=52&smallclassid=5201&searchKeys=%C1%AC%BD%D3%25%CA%FD%BE%DD%BF%E2&author=&tabletype=now

解决方案 »

  1.   

    <appSettings>
    <add key="DSN" value="Data Source=202.96.137.85;initial catalog=EA;uid=sa;pwd=123456"/>
    </appSettings>写作Web.config
      

  2.   

    连接到sql2000   然后显示出来,在进行读写操作???
    杂办???大虾 帮帮我!!急急
      

  3.   

    using System;
    using System.Data;
    using System.Data.SqlClient;class Sample
    {
      public static void Main() 
      {
        SqlConnection nwindConn = new SqlConnection("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=northwind");    SqlCommand catCMD = nwindConn.CreateCommand();
        catCMD.CommandText = "SELECT CategoryID, CategoryName FROM Categories";    nwindConn.Open();    SqlDataReader myReader = catCMD.ExecuteReader();    while (myReader.Read())
        {
          Console.WriteLine("\t{0}\t{1}", myReader.GetInt32(0), myReader.GetString(1));
        }    myReader.Close();
        nwindConn.Close();
      }
    }
      

  4.   

    兄弟,你比我还菜啊连接到sql server2000,需要建立sqlconnection 和sqlcommand对象
      

  5.   

    看看msdn的帮助吧,查询SqlConnection这个类。
      

  6.   

    using System.Data;
    using System.Data.OleDb;
    ---------------------------
    OleDbConnection thisConnection=new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\D\DevCs\Works2\Person.mdb;");
    thisConnection.Open();
    OleDbCommand thisCommand=thisConnection.CreateCommand(); //
    thisCommand.CommandText="SELECT * FROM Intro";
    OleDbDataReader thisReader=thisCommand.ExecuteReader();
    while(thisReader.Read())
    {
    Console.WriteLine("\t{0}\t{1}",thisReader["ID"],thisReader["TheName"]);
    }
    thisReader.Close();
    thisConnection.Close();