diff options
author | Umadevi S <uma@mono-cvs.ximian.com> | 2004-06-18 08:23:08 +0400 |
---|---|---|
committer | Umadevi S <uma@mono-cvs.ximian.com> | 2004-06-18 08:23:08 +0400 |
commit | 46aa685e63d73db3a592e8f79a5d6aa04771c74c (patch) | |
tree | 2d836099751ca9e898f78d0510bf509764e3f827 /mcs | |
parent | 927f734e4aa91acee2e7b4ed41e76e7d1dd7b0c4 (diff) |
2004-06-18 Umadevi S <sumadevi@novell.com>
* SqlConnection.cs - handled null being passed as a connectionstring
- checked for minimal set of parameters in connectionstring.
- handled unrecogonized keywords similar to MS.NET
svn path=/trunk/mcs/; revision=29846
Diffstat (limited to 'mcs')
-rwxr-xr-x | mcs/class/System.Data/System.Data.SqlClient/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog index bdd8bbee971..4b5cec2526d 100755 --- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog @@ -1,3 +1,8 @@ +2004-06-18 Umadevi S <sumadevi@novell.com> + * SqlConnection.cs - handled null being passed as a connectionstring + - checked for minimal set of parameters in connectionstring. + - handled unrecogonized keywords similar to MS.NET + 2004-06-17 Umadevi S <sumadevi@novell.com> * SqlTransaction.cs - fixed multiple rollbacks being called causes invalidoperationexception diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs index d2bcf2aa158..40ad7787059 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs @@ -416,6 +416,9 @@ namespace System.Data.SqlClient { { theServerName = ""; string theInstanceName = ""; + if ((theDataSource == null) || (theServerName == null)) + throw new ArgumentException("Format of initialization string doesnot conform to specifications"); + thePort = 1433; // default TCP port for SQL Server bool success = true; @@ -456,7 +459,7 @@ namespace System.Data.SqlClient { { NameValueCollection parameters = new NameValueCollection (); - if (connectionString.Length == 0) + if (( connectionString == null)||( connectionString.Length == 0)) return; connectionString += ";"; @@ -545,8 +548,8 @@ namespace System.Data.SqlClient { this.connectionString = connectionString; } - - void SetDefaultConnectionParameters (NameValueCollection parameters) + + void SetDefaultConnectionParameters (NameValueCollection parameters) { if (null == parameters.Get ("APPLICATION NAME")) parameters["APPLICATION NAME"] = "Mono SqlClient Data Provider"; @@ -655,7 +658,9 @@ namespace System.Data.SqlClient { case "WORKSTATION ID" : parms.Hostname = value; break; - } + default : + throw new ArgumentException("Keyword not supported :"+name); + } } } |