资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

数据库连接错误,大家看看

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

操作系统:2003,数据库:sqlserver2000。程序中的ConnectionString为:"workstation   id=\"HUST-QJA9VNLTQR\";packet   size=4096;user   id=sa;data   source=localhost;persist   security   info=False;initial   catalog=JiaoGuanDB"运行open()函数出现错误:An   unhandled   exception   of   type   System.Data.SqlClient.SqlException   occurred   in   system.data.dll  
  Additional   information:   系统错误。  
  DefaultDomain:   Loaded   c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll,   No   symbols   loaded.  
  dataBase1:   Loaded   F:\study_code\test1\dataBase1\dataBase1\bin\Debug\dataBase1.exe,   Symbols   loaded.  
  dataBase1.exe:   Loaded   c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll,   No   symbols   loaded.  
  dataBase1.exe:   Loaded   c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll,   No   symbols   loaded.  
  dataBase1.exe:   Loaded   c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll,   No   symbols   loaded.  
  dataBase1.exe:   Loaded   c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.thunk.dll,   No   symbols   loaded.  
  dataBase1.exe:   Loaded   c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll,   No   symbols   loaded.  
  dataBase1.exe:   Loaded   c:\windows\assembly\gac\mscorlib.resources\1.0.5000.0_zh-chs_b77a5c561934e089\mscorlib.resources.dll,   No   symbols   loaded.  
  An   unhandled   exception   of   type   System.Data.SqlClient.SqlException   occurred   in   system.data.dll  
   
  Additional   information:   系统错误。  
   
  The   program   [3856]   dataBase1.exe   has   exited   with   code   0   (0x0).  
  无从下手,请指点!谢谢!!

网友回答:

发表者:sweetsoft

在你的   user   id=sa;后面加上password=xxxx;如果口令为空则为:password=;

发表者:whmjw

参照:www.connectionstrings.com  
   
  Standard   Security:  
   
  "Data   Source=Aron1;Initial   Catalog=pubs;User   Id=sa;Password=asdasd;"    
        -   or   -  
  "Server=Aron1;Database=pubs;User   ID=sa;Password=asdasd;Trusted_Connection=False"    
        (booth   connection   strings   produces   the   same   result)  
   
   
   
   
    Trusted   Connection:  
   
  "Data   Source=Aron1;Initial   Catalog=pubs;Integrated   Security=SSPI;"    
        -   or   -  
  "Server=Aron1;Database=pubs;Trusted_Connection=True;"    
        (booth   connection   strings   produces   the   same   result)  
   
  (use   serverName\instanceName   as   Data   Source   to   use   an   specifik   SQLServer   instance,   only   SQLServer2000)  
    Connect   via   an   IP   address:  
   
  "Data   Source=190.190.200.100,1433;Network   Library=DBMSSOCN;Initial   Catalog=pubs;User   ID=sa;Password=asdasd;"    
  (DBMSSOCN=TCP/IP   instead   of   Named   Pipes,   at   the   end   of   the   Data   Source   is   the   port   to   use   (1433   is   the   default))  
 

发表者:songhtao

在ide里的设计器里连一下,看看连接字符串是什么就知道了。


 

 
热门推荐笔记本: 方正笔记本
相关文章:
笔记本相关:
IT技术文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved