using System.Data.SqlClient;
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString="my connection string";
oSQLConn.Open(); 这种连接方式需要安装客户端吗?oSQLConn.ConnectionString="my connection string";
中的my connection string具体如何写?

解决方案 »

  1.   

    1.如果非ASP,客户端必须装.Net Framework
    2.连接字串:
    1)SQL帐户登录:oSQLConn.ConnectionString="Server=服务器IP;User ID=SQL帐户;Password=SQL密码;Initial Catalog=数据库;"  
    2)集成登录
    oSQLConn.ConnectionString="Server=服务器IP;Integrated Security=True;Initial Catalog=数据库;"
      

  2.   

    workstation id=All;packet size=4096;UID=sa;password=;data source=(local);persist security info=True;initial catalog=TestOnline;Max Pool Size=500;Min Pool Size=5
      

  3.   

    链接字符串,楼上的已经说了如果你的程序是C/S架构的,当然要在客户端安装dotNET Framework,如果是B/S架构(比如说ASP.NET)就不用装了,服务器端装好就可以了
      

  4.   

    你是不是用的Enterprise Library 呀
    如果是的话很简单
    你安装了Enterprise Library的话,开始中找到他
    他有一个自带的APP.CONFIG或WEB.CONFIG编辑器,你在那里写就是,注意把验证方式改成False就行了