Diane

Diane

  • NA
  • 33
  • 26.2k

C#.net 2008 working with sql server

Jun 23 2011 11:28 AM

I am going to be changing a C#.net 2008 desktop application to point from one production sql server database to a new production database. Basically the tables and columns will be changing in the new version of the production database. I am suppose to use the same desktop that users are currently working with and point everything to the new database.

I believe the original application was written with the drag and drop features that visual studio.net 2008 has. Thus my question is which option to chose to point to the new production database:

1. Should I create all drag and drop obejcts and remove the 'old' drag and drop obejcts? If so, how would i accomplish this task?

2. Should I modify the exising code? If so, are there any recommendations you have for me that I should follow? The code looks like the following:

[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public brw_QueryByRecordTableAdapter() {
            this.ClearBeforeFill = true;

 brw_QueryByRecordTableAdapter adapter = new brw_QueryByRecordTableAdapter();

[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
            get {
                if ((this._commandCollection == null)) {
                    this.InitCommandCollection();
                }
                return this._commandCollection;
            }

  Browser.brw_QueryByRecordDataTable dataTable = new Browser.brw_QueryByRecordDataTable();
            this.Adapter.Fill(dataTable);
            return dataTable;

 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public brw_QueryByRecordDataTable() {
                this.TableName = "brw_QueryByRecord";
                this.BeginInit();
                this.InitClass();
                this.EndInit();
            }

 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private void InitClass() {
                this.columnRec_ID = new global::System.Data.DataColumn("Rec_ID", typeof(int), null,

global::System.Data.MappingType.Element);
                base.Columns.Add(this.columnRec_ID);
                this.columnIG_REC_Date = new global::System.Data.DataColumn("REC_Date",

typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
                base.Columns.Add(this.columnREC_Date);
                this.columnSubmission_id = new global::System.Data.DataColumn("Sub_id", typeof(int), null,

global::System.Data.MappingType.Element);
                base.Columns.Add(this.columnSub_id);
             

                return adapter.GetDataQueryByRecord(recId, null);


3. Is there another way you would recommend that i accomplish this task?



Answers (1)