Ejemplo n.º 1
0
        internal void DeriveParameters()
        {
            if (commandType != CommandType.StoredProcedure)
            {
                throw new InvalidOperationException(String.Format("TdsCommand DeriveParameters only supports CommandType.StoredProcedure, not CommandType.{0}", commandType));
            }
            ValidateCommand("DeriveParameters");

            TdsParameterCollection localParameters = new TdsParameterCollection(this);

            localParameters.Add("@P1", TdsType.NVarChar, commandText.Length).Value = commandText;

            string sql = "sp_procedure_params_rowset";

            Connection.Tds.ExecProc(sql, localParameters.MetaParameters, 0, true);

            TdsDataReader reader = new TdsDataReader(this);

            parameters.Clear();
            object[] dbValues = new object[reader.FieldCount];

            while (reader.Read())
            {
                reader.GetValues(dbValues);
                parameters.Add(new TdsParameter(dbValues));
            }
            reader.Close();
        }
Ejemplo n.º 2
0
        public TdsCommand(string commandText, TdsConnection connection, TdsTransaction transaction)
        {
            this.commandText      = commandText;
            this.connection       = connection;
            this.transaction      = transaction;
            this.commandType      = CommandType.Text;
            this.updatedRowSource = UpdateRowSource.Both;

            this.designTimeVisible = false;
            this.commandTimeout    = 30;
            parameters             = new TdsParameterCollection(this);
        }
Ejemplo n.º 3
0
		public TdsCommand (string commandText, TdsConnection connection, TdsTransaction transaction) 
		{
			this.commandText = commandText;
			this.connection = connection;
			this.transaction = transaction;
			this.commandType = CommandType.Text;
			this.updatedRowSource = UpdateRowSource.Both;

			this.designTimeVisible = false;
			this.commandTimeout = 30;
			parameters = new TdsParameterCollection (this);
		}
Ejemplo n.º 4
0
		internal void DeriveParameters ()
		{
			if (commandType != CommandType.StoredProcedure)
				throw new InvalidOperationException (String.Format ("TdsCommand DeriveParameters only supports CommandType.StoredProcedure, not CommandType.{0}", commandType));
			ValidateCommand ("DeriveParameters");

			TdsParameterCollection localParameters = new TdsParameterCollection (this);
			localParameters.Add ("@P1", TdsType.NVarChar, commandText.Length).Value = commandText;

			string sql = "sp_procedure_params_rowset";

			Connection.Tds.ExecProc (sql, localParameters.MetaParameters, 0, true);

			TdsDataReader reader = new TdsDataReader (this);
			parameters.Clear ();
			object[] dbValues = new object[reader.FieldCount];

			while (reader.Read ()) {
				reader.GetValues (dbValues);
				parameters.Add (new TdsParameter (dbValues));
			}
			reader.Close ();	
		}