title: ADODB parameter not sending input value
body: <p>I have spent more time than i care to mention trying to sort this one out.  I am trying to call a stored procedure using adodb command execute in c#.  I am doing the same thing for all of my parameters but the first will always send 'system.object' instead of the value i want input.  I'd be very grateful for any help.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>ADODB.Connection con;
          ADODB.Command com;
          ADODB.Recordset rst;
          ADODB.Parameter prm;
  
          con = null;
          con = new ADODB.Connection();
          con.Provider = "SQLOLEDB.1";
          con.ConnectionString = "Description=MyDB;IntegratedSecurity=SSPI;Trusted_Connection=Yes;APP=MyApp;WSID=MyServer;DATABASE=MyDB";
          con.Open(con.ConnectionString , null, null, 0);
  
          com = null;
          com = new ADODB.Command();
          com.CommandText = "MyStoredProc";
          com.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc;
          com.NamedParameters = true;
          com.Prepared = false;
          com.Name = ("MyStoredProc" + System.DateTime.Now.ToString("yyyyMMddHHmmssffff"));
  
          prm = null;
  
  
          //Location parameter
          prm = com.CreateParameter("@LocationNameIn", DataTypeEnum.adVarChar, ParameterDirectionEnum.adParamInput, 80, Convert.ToString("London"));
          com.Parameters.Append(prm);
          prm.Value = Convert.ToString("London");
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Time", DataTypeEnum.adDBTimeStamp, ParameterDirectionEnum.adParamInput, 0, Convert.ToDateTime("01/12/2011 00:20"));
          com.Parameters.Append(prm);
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Param3", DataTypeEnum.adDouble, ParameterDirectionEnum.adParamInput, 0, 1000.0);
          com.Parameters.Append(prm);
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Param4", DataTypeEnum.adDouble, ParameterDirectionEnum.adParamInput, 0, -999);
          com.Parameters.Append(prm);
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Param5", DataTypeEnum.adDouble, ParameterDirectionEnum.adParamInput, 0, 245.9);
          com.Parameters.Append(prm);
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Param6", DataTypeEnum.adDouble, ParameterDirectionEnum.adParamInput, 0, -999);
          com.Parameters.Append(prm);
  
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Param7", DataTypeEnum.adVarChar, ParameterDirectionEnum.adParamInput, 20, "South");
          com.Parameters.Append(prm);
          prm = null;
  
          //parameter
          prm = com.CreateParameter("@Param8", DataTypeEnum.adDouble , ParameterDirectionEnum.adParamInput, 0, 0);
          com.Parameters.Append(prm);
          prm = null;
  
          // parameter
          prm = com.CreateParameter("@Param9", DataTypeEnum.adVarChar, ParameterDirectionEnum.adParamInput, 120, "BlahdiblahPC");
          com.Parameters.Append(prm);
          prm = null;
  
  
          com.ActiveConnection = con;
          object oRA = new object();
          object oPRM = new object();
          rst = com.Execute(out oRA, ref oPRM, (int)ExecuteOptionEnum.adExecuteRecord);
  </code></pre>
  
  <p>When i do a trace on the database i get the following:</p>
  
  <blockquote>
    <p>exec MyStoredProc @LocationNameIn='System.Object',@Time='2011-12-01
    00:20:00',@Param3=1000,@Param4=-999,@Param5=245.90000000000001,@Param6=-999,@Param7='South',@Param8=0,@Param9='BlahdiblahP
    C'</p>
  </blockquote>
  
  <p>So all the parameters are working fine except for the first.  I have played about with datatypes for the parameter and with execution options for the command execute method but really don't have any idea where to start.</p>
  
  <p>Thanks in advance!!!</p>