Ðåôåðàòû. Àíàëèç òåêñòîâ íà çàèìñòâîâàíèå ìåòîäîì ïîñòðîåíèÿ ñåìàíòè÷åñêèõ ìîäåëåé

            this._adapter = new System.Data.SqlClient.SqlDataAdapter();

            System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();

            tableMapping.SourceTable = "Table";

            tableMapping.DataSetTable = "texts";

            tableMapping.ColumnMappings.Add("text_id", "text_id");

            tableMapping.ColumnMappings.Add("text", "text");

            tableMapping.ColumnMappings.Add("text_caption", "text_caption");

            this._adapter.TableMappings.Add(tableMapping);

            this._adapter.InsertCommand = new System.Data.SqlClient.SqlCommand();

            this._adapter.InsertCommand.Connection = this.Connection;

            this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[texts] ([text], [text_caption]) VALUES (@text, @text_caption)";

            this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;

            this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@text", System.Data.SqlDbType.NText, 0, System.Data.ParameterDirection.Input, 0, 0, "text", System.Data.DataRowVersion.Current, false, null, "", "", ""));

            this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@text_caption", System.Data.SqlDbType.NChar, 0, System.Data.ParameterDirection.Input, 0, 0, "text_caption", System.Data.DataRowVersion.Current, false, null, "", "", ""));

        }

        

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        private void InitConnection() {

            this._connection = new System.Data.SqlClient.SqlConnection();

            this._connection.ConnectionString = global::app.Properties.Settings.Default.adbConnectionString;

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        private void InitCommandCollection() {

            this._commandCollection = new System.Data.SqlClient.SqlCommand[1];

            this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();

            this._commandCollection[0].Connection = this.Connection;

            this._commandCollection[0].CommandText = "SELECT text_id, text, text_caption FROM dbo.texts";

            this._commandCollection[0].CommandType = System.Data.CommandType.Text;

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]

        public virtual int Fill(adbDataSet.textsDataTable dataTable) {

            this.Adapter.SelectCommand = this.CommandCollection[0];

            if ((this.ClearBeforeFill == true)) {

                dataTable.Clear();

            }

            int returnValue = this.Adapter.Fill(dataTable);

            return returnValue;

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]

        public virtual adbDataSet.textsDataTable GetData() {

            this.Adapter.SelectCommand = this.CommandCollection[0];

            adbDataSet.textsDataTable dataTable = new adbDataSet.textsDataTable();

            this.Adapter.Fill(dataTable);

            return dataTable;

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        public virtual int Update(adbDataSet.textsDataTable dataTable) {

            return this.Adapter.Update(dataTable);

        }

        

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        public virtual int Update(adbDataSet dataSet) {

            return this.Adapter.Update(dataSet, "texts");

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        public virtual int Update(System.Data.DataRow dataRow) {

            return this.Adapter.Update(new System.Data.DataRow[] {

                        dataRow});

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        public virtual int Update(System.Data.DataRow[] dataRows) {

            return this.Adapter.Update(dataRows);

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]

        public virtual int Insert(string text, string text_caption) {

            if ((text == null)) {

                this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;

            }

            else {

                this.Adapter.InsertCommand.Parameters[0].Value = ((string)(text));

            }

            if ((text_caption == null)) {

                this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;

            }

            else {

                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(text_caption));

            }

            System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;

            if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)

                        != System.Data.ConnectionState.Open)) {

                this.Adapter.InsertCommand.Connection.Open();

            }

            try {

                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();

                return returnValue;

            }

            finally {

                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {

                    this.Adapter.InsertCommand.Connection.Close();

                }

            }

        }

    }

   

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]

    [System.ComponentModel.DesignerCategoryAttribute("code")]

    [System.ComponentModel.ToolboxItem(true)]

    [System.ComponentModel.DataObjectAttribute(true)]

    [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +

        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]

    [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

    public partial class QueriesTableAdapter : System.ComponentModel.Component {

       

        private System.Data.IDbCommand[] _commandCollection;

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        protected System.Data.IDbCommand[] CommandCollection {

            get {

                if ((this._commandCollection == null)) {

                    this.InitCommandCollection();

                }

                return this._commandCollection;

            }

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        private void InitCommandCollection() {

            this._commandCollection = new System.Data.IDbCommand[1];

            this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();

            ((System.Data.SqlClient.SqlCommand)(this._commandCollection[0])).Connection = new System.Data.SqlClient.SqlConnection(global::app.Properties.Settings.Default.adbConnectionString);

            ((System.Data.SqlClient.SqlCommand)(this._commandCollection[0])).CommandText = "INSERT into texts(text, text_caption) values (:text, :text_caption)";

            ((System.Data.SqlClient.SqlCommand)(this._commandCollection[0])).CommandType = System.Data.CommandType.Text;

        }

       

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

        [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, false)]

        public virtual int SQLInsText() {

            System.Data.SqlClient.SqlCommand command = ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[0]));

            System.Data.ConnectionState previousConnectionState = command.Connection.State;

            if (((command.Connection.State & System.Data.ConnectionState.Open)

                        != System.Data.ConnectionState.Open)) {

                command.Connection.Open();

            }

            int returnValue;

            try {

                returnValue = command.ExecuteNonQuery();

            }

            finally {

                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {

                    command.Connection.Close();

                }

            }

            return returnValue;

        }

    }

}


#pragma warning restore 1591






CFileReader


using System;

using System.Collections.Generic;

using System.Text;

using System.IO;


namespace app

{

    static class CFileReader

    {

        /// <summary>

        /// ب᳥𡣥򺡴᪫ ࡱ󱯪񋈠       /// </summary>

        /// <param name="filename">ɬ��param>

        /// <returns>Ҳ񯫠, 򯥥񧡹ὠ塭 饠��returns>

Ñòðàíèöû: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42



2012 © Âñå ïðàâà çàùèùåíû
Ïðè èñïîëüçîâàíèè ìàòåðèàëîâ àêòèâíàÿ ññûëêà íà èñòî÷íèê îáÿçàòåëüíà.