+2008-04-01 Marek Habersack <mhabersack@novell.com>
+
+ * SqlParameter.cs: ConvertToFrameworkType must handle empty
+ strings gracefully - a DBNull.Value must be returned in this
+ case.
+
+ * SqlCommand.cs: DeriveParameters should split the stored
+ procedure name into the schema name and procedure name before
+ querying its parameters.
+
2008-03-03 Ankit Jain <jankit@novell.com>
* SqlClientMetaDataCollectionNames.cs: Set the field values.
throw new InvalidOperationException (String.Format ("SqlCommand DeriveParameters only supports CommandType.StoredProcedure, not CommandType.{0}", commandType));
ValidateCommand ("DeriveParameters");
+ string procName = CommandText;
+ string schemaName = String.Empty;
+ int dotPosition = procName.IndexOf ('.');
+ if (dotPosition >= 0) {
+ schemaName = procName.Substring (0, dotPosition);
+ procName = procName.Substring (dotPosition + 1);
+ }
+
SqlParameterCollection localParameters = new SqlParameterCollection (this);
- localParameters.Add ("@procedure_name", SqlDbType.NVarChar, CommandText.Length).Value = CommandText;
-
+ localParameters.Add ("@procedure_name", SqlDbType.NVarChar, procName.Length).Value = procName;
+ if (schemaName.Length > 0)
+ localParameters.Add ("@procedure_schema", SqlDbType.NVarChar, schemaName.Length).Value = schemaName;
+
string sql = "sp_procedure_params_rowset";
try {