3tier
-
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
-
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
-
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:
-
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
-
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
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 -
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
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.