【正文】
oo等。所以我們?cè)诖a中要剔除掉。本來(lái)想用更輕便的MyXLS,但發(fā)現(xiàn)它不支持單背景色。所以只能放棄LINQ,老老實(shí)實(shí)地寫老派的代碼了。 代碼(讓你容易找點(diǎn)。using 。using 。 args[2] = user。 string user = 2 ? args[2] : 。 (db, dataSource, user, password)。 } private static void OnWorkProgress(object sender, ProgressEventArgs e) { ()。 CellStyle nameStyle = new CellStyle(xls)。 [0, 0].Value = ({0} database dictionary, Database)。 [4, 1].Style = nameStyle。Persist Security Info=True。 using (SqlConnection connection = new SqlConnection(connectionString)) { ()。, Stored Procedures, new Liststring(new string[] { sp_alterdiagram, sp_creatediagram, sp_dropdiagram, sp_helpdiagramdefinition, sp_helpdiagrams, sp_renamediagram, sp_upgraddiagrams }), sheet, ref index)。IF39。 AddObjects(connection, 39。 } string path = (().Location) + \ + Database + .xls。 = 。 = 。 Index++。 if ( 0) { DataTable objects = [0]。 if (!(objectName)) { [Index, 0].Value = objectName。{0}39。 Dictionarystring, KeyValuePairstring, string uniqueDependencies = new Dictionarystring, KeyValuePairstring, string()。 if (().StartsWith(dbo.)) itemName = (4)。 } (new KVPComparer())。 } } else { Index++。 } else AddProgress((({0}/{1}) {2} ignored, i + 1, , objectName))。 } } public class ProgressEventArgs : EventArgs { private string status。 } } internal class KVPComparer : IComparerKeyValuePairstring, string { public int Compare(KeyValuePairstring, string x, KeyValuePairstring, string y) { int pare = (, )。),在命令行(改成Win應(yīng)用也可以?。┹斎?個(gè)參數(shù):數(shù)據(jù)庫(kù)名、服務(wù)器名和密碼。 最后輸出的的EXCEL文件有6000多行,我真懷疑到底有多少人愿意看這個(gè)文件。所以,也便有了 數(shù)據(jù)處理利器SSIS入門與進(jìn)階 這篇文章,省得讓我的研究給扔到大海。最后發(fā)現(xiàn)是SQL Plan出了問(wèn)題,只需要修改一下存儲(chǔ)過(guò)程(隨便加個(gè)空行),保存便可,不需要SET ARITHABORT ON。Paste到WinForm/WPF/WebForm/ MVC...資料引用:數(shù)據(jù)庫(kù)連接字符串大全轉(zhuǎn)自: SQL Server ODBC Standard Security:Driver={SQL Server}。Pwd=asdasd。Trusted_Connection=yes。 OLE DB, OleDbConnection (.NET) Standard Security:Provider=sqloledb。Password=asdasd。Integrated Security=SSPI。Data Source=,1433。Password=asdasd。Password=asdasd。Password=asdasd。 or Server=Aron1。Network Library=DBMSSOCN。 (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default)) Declare the SqlConnection:C:using 。 :Imports Dim oSQLConn As SqlConnection = New SqlConnection()=my connection string() Data Shape MS Data ShapeProvider=MSDataShape。User ID=sa。Data Source=,1433。Password=asdasd。database39。false39。s current transaction context. Initial CatalogorDatabase The name of the database. Integrated SecurityorTrusted_Connection 39。, 39。, which is equivalent to 39。 The network library used to establish a connection to an instance of SQL Server. Supported values include dbnmpntw (Named Pipes), dbmsrp (Multiprotocol), dbmsadsn (Apple Talk), dbmsgnet (VIA), dbmsip (Shared Memory) and dbmsspxn (IPX/SPX), and dbmsso (TCP/IP). The corresponding network DLL must be installed on the system to which you connect. If you do not specify a network and you use a local server (for example, . or (local)), shared memory is used. Packet Size 8192 Size in bytes of the network packets used to municate with an instance of SQL Server. PasswordorPwd The password for the SQL Server account logging on. Persist Security Info 39。, securitysensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password. Pooling 39。t change the connection string by inserting an additional property with another value within the user value. SQL Server 2005 SQL Native Client ODBC Driver Standard security:Driver={SQL Native Client}。PWD=asdasd。Trusted_Connection=yes。 Enabling MARS (multiple active result sets):Driver={SQL Native Client}。MARS_Connection=yes EquivalentsMultipleActiveResultSets=true equals MARS_Connection=yesUsing MARS with SQL Native Client, by Chris Lee Encrypt data sent over network:Driver={SQL Native Client}。Encrypt=yes Attach a database file on connect to a local SQL Server Express instance:Driver={SQL Native Client}。Trusted_Connection=Yes。Database=dbname。Server=Aron1。 Trusted connection:Provider=SQLNCLI。 EquivalentsIntegrated Security=SSPI equals Trusted_Connection=yes Prompt for username and password:(Prompt) = adPromptAlways Provider=SQLNCLI。Server=Aron1。Server=Aron1。Server=.\SQLExpress。 or Provider=SQLNCLI。Trusted_Connection=Yes。User Id=sa。User ID=sa。Integrated Security=SSPI。 (both connection strings produces the same result)(use serverName\instanceName as Data Source to use an specifik SQLServer instance) Connect via an IP address:Data Source=,1433。Password=asdasd。MultipleActiveResultSets=true Note! Use for MARS functionality. MARS is not supported in nor Streamline your Data Connections by Moving to MARS, by Laurence Moroney, Attach a database file on connect to a local SQL Server Express instance:Server=.\SQLExpress。Truste