コード例 #1
0
        /// <summary>
        /// Finds a Testsqlentity2 entity using it's primary key.
        /// </summary>
        /// <returns>A Testsqlentity2Data object.</returns>
        /// <exception cref="Spring2.Core.DAO.FinderException">Thrown when no entity exists witht he specified primary key..</exception>
        public static Testsqlentity2Data Load()
        {
            WhereClause   w          = new WhereClause();
            SqlDataReader dataReader = GetListReader(CONNECTION_STRING_KEY, VIEW, w, null);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for Testsqlentity2.");
            }
            Testsqlentity2Data data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
コード例 #2
0
        /// <summary>
        /// Updates a record in the Testsqlentity2 table.
        /// </summary>
        /// <param name=""></param>
        public static void Update(Testsqlentity2Data data, SqlTransaction transaction)
        {
            // Create and execute the command
            SqlCommand cmd = GetSqlCommand(CONNECTION_STRING_KEY, "spTestsqlentity2_Update", CommandType.StoredProcedure, COMMAND_TIMEOUT, transaction);

            //Create the parameters and append them to the command object

            // Execute the query
            cmd.ExecuteNonQuery();

            // do not close the connection if it is part of a transaction
            if (transaction == null)
            {
                cmd.Connection.Close();
            }
        }
コード例 #3
0
 /// <summary>
 /// Updates a record in the Testsqlentity2 table.
 /// </summary>
 /// <param name=""></param>
 public static void Update(Testsqlentity2Data data)
 {
     Update(data, null);
 }
コード例 #4
0
 /// <summary>
 /// Inserts a record into the Testsqlentity2 table.
 /// </summary>
 /// <param name=""></param>
 public static void Insert(Testsqlentity2Data data)
 {
     Insert(data, null);
 }
コード例 #5
0
        /// <summary>
        /// Builds a data object from the current row in a data reader..
        /// </summary>
        /// <param name="dataReader">Container for database row.</param>
        /// <returns>Data object built from current row.</returns>
        private static Testsqlentity2Data GetDataObjectFromReader(SqlDataReader dataReader)
        {
            Testsqlentity2Data data = new Testsqlentity2Data();

            return(data);
        }