Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. 3tier

3tier

Scheduled Pinned Locked Moved C#
databasegraphicsquestion
6 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Trustapple
    wrote on last edited by
    #1

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Data.SqlClient; namespace GUI { public partial class GUI : Form { public GUI() { InitializeComponent(); } private void GUI_Load(object sender, EventArgs e) { } private void btnCreate_Click(object sender, EventArgs e) { if (ifthursday()) { CreateDatabase(GetDatabasename()); CreateDatatable(GetTableName(), GetDatabasename()); } } /// /// Gets the name of the database from datetime picker and returns the value to the createDatabase Method /// /// /// public void Kill() { return; } public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } public bool ifthursday() { //string dayisthursday= dateTimePicker1.Value.ToString("") if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("Thursday")) { MessageBox.Show("Thursday"); } else if (MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.No) { return false; } return true; } /// /// Gets the name of the table from the datetime picker and returns the value to the createDatatable Method /// /// public string GetTableName() { string nameTable = dateTimePicker1.Value.ToString("MMddyy"); string nameTB = "CustList_PGE" + nameTable; MessageBox.Show("The name of the Table will be CustList_PGE" + nameTable); return nameTB; } //public void con() //{ // Businesslayer.Businesslayer

    L J D P 4 Replies Last reply
    0
    • T Trustapple

      using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Data.SqlClient; namespace GUI { public partial class GUI : Form { public GUI() { InitializeComponent(); } private void GUI_Load(object sender, EventArgs e) { } private void btnCreate_Click(object sender, EventArgs e) { if (ifthursday()) { CreateDatabase(GetDatabasename()); CreateDatatable(GetTableName(), GetDatabasename()); } } /// /// Gets the name of the database from datetime picker and returns the value to the createDatabase Method /// /// /// public void Kill() { return; } public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } public bool ifthursday() { //string dayisthursday= dateTimePicker1.Value.ToString("") if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("Thursday")) { MessageBox.Show("Thursday"); } else if (MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.No) { return false; } return true; } /// /// Gets the name of the table from the datetime picker and returns the value to the createDatatable Method /// /// public string GetTableName() { string nameTable = dateTimePicker1.Value.ToString("MMddyy"); string nameTB = "CustList_PGE" + nameTable; MessageBox.Show("The name of the Table will be CustList_PGE" + nameTable); return nameTB; } //public void con() //{ // Businesslayer.Businesslayer

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      led mike

      M 1 Reply Last reply
      0
      • L led mike

        led mike

        M Offline
        M Offline
        MidwestLimey
        wrote on last edited by
        #3

        35 postings, 5 of them voted 1, with one 2 voter. Think that speaks for itself.


        I'm largely language agnostic


        After a while they all bug me :doh:


        1 Reply Last reply
        0
        • T Trustapple

          using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Data.SqlClient; namespace GUI { public partial class GUI : Form { public GUI() { InitializeComponent(); } private void GUI_Load(object sender, EventArgs e) { } private void btnCreate_Click(object sender, EventArgs e) { if (ifthursday()) { CreateDatabase(GetDatabasename()); CreateDatatable(GetTableName(), GetDatabasename()); } } /// /// Gets the name of the database from datetime picker and returns the value to the createDatabase Method /// /// /// public void Kill() { return; } public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } public bool ifthursday() { //string dayisthursday= dateTimePicker1.Value.ToString("") if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("Thursday")) { MessageBox.Show("Thursday"); } else if (MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.No) { return false; } return true; } /// /// Gets the name of the table from the datetime picker and returns the value to the createDatatable Method /// /// public string GetTableName() { string nameTable = dateTimePicker1.Value.ToString("MMddyy"); string nameTB = "CustList_PGE" + nameTable; MessageBox.Show("The name of the Table will be CustList_PGE" + nameTable); return nameTB; } //public void con() //{ // Businesslayer.Businesslayer

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          Trustapple, Trustapple, Trustapple.... you just don't learn do you?

          1 Reply Last reply
          0
          • T Trustapple

            using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Data.SqlClient; namespace GUI { public partial class GUI : Form { public GUI() { InitializeComponent(); } private void GUI_Load(object sender, EventArgs e) { } private void btnCreate_Click(object sender, EventArgs e) { if (ifthursday()) { CreateDatabase(GetDatabasename()); CreateDatatable(GetTableName(), GetDatabasename()); } } /// /// Gets the name of the database from datetime picker and returns the value to the createDatabase Method /// /// /// public void Kill() { return; } public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } public bool ifthursday() { //string dayisthursday= dateTimePicker1.Value.ToString("") if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("Thursday")) { MessageBox.Show("Thursday"); } else if (MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.No) { return false; } return true; } /// /// Gets the name of the table from the datetime picker and returns the value to the createDatatable Method /// /// public string GetTableName() { string nameTable = dateTimePicker1.Value.ToString("MMddyy"); string nameTB = "CustList_PGE" + nameTable; MessageBox.Show("The name of the Table will be CustList_PGE" + nameTable); return nameTB; } //public void con() //{ // Businesslayer.Businesslayer

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Last I checked, the CodeProject site didn't become a source code repository. You might want to ask an actual question on this code before someone start flaming you...oh, wait... My bad! I was too late!

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            • T Trustapple

              using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Data.SqlClient; namespace GUI { public partial class GUI : Form { public GUI() { InitializeComponent(); } private void GUI_Load(object sender, EventArgs e) { } private void btnCreate_Click(object sender, EventArgs e) { if (ifthursday()) { CreateDatabase(GetDatabasename()); CreateDatatable(GetTableName(), GetDatabasename()); } } /// /// Gets the name of the database from datetime picker and returns the value to the createDatabase Method /// /// /// public void Kill() { return; } public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } public bool ifthursday() { //string dayisthursday= dateTimePicker1.Value.ToString("") if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("Thursday")) { MessageBox.Show("Thursday"); } else if (MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.No) { return false; } return true; } /// /// Gets the name of the table from the datetime picker and returns the value to the createDatatable Method /// /// public string GetTableName() { string nameTable = dateTimePicker1.Value.ToString("MMddyy"); string nameTB = "CustList_PGE" + nameTable; MessageBox.Show("The name of the Table will be CustList_PGE" + nameTable); return nameTB; } //public void con() //{ // Businesslayer.Businesslayer

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              You might want to consider investing in a source control system or moving this to the recylce bin. Either way, don't clutter up the forums. But I do have to catch you with this bit:

              Trustapple wrote:

              try { cmdObj.Connection = conObj; cmdObj.CommandText = "createTable"; cmdObj.CommandType = System.Data.CommandType.StoredProcedure; cmdObj.Parameters.AddWithValue("@databaseName", nameDB); cmdObj.Parameters.AddWithValue("@databaseTable", tableName); cmdObj.Parameters.AddWithValue("@primaryKey", @"ClientCoCustListID"); cmdObj.ExecuteNonQuery(); } catch (Exception ex) { } finally { } }

              Never ever catch an exception and do nothing with it - and certainly don't have a finally block that does nothing.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups