Click here to Skip to main content
15,881,852 members
Home / Discussions / C#
   

C#

 
AnswerRe: No column found exception occourd Pin
Kornfeld Eliyahu Peter21-Jul-14 2:21
professionalKornfeld Eliyahu Peter21-Jul-14 2:21 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 2:50
vishavajeet21-Jul-14 2:50 
AnswerRe: No column found exception occourd Pin
Kornfeld Eliyahu Peter21-Jul-14 2:51
professionalKornfeld Eliyahu Peter21-Jul-14 2:51 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 3:08
vishavajeet21-Jul-14 3:08 
GeneralRe: No column found exception occourd Pin
Eddy Vluggen21-Jul-14 3:02
professionalEddy Vluggen21-Jul-14 3:02 
SuggestionRe: No column found exception occourd Pin
Richard Deeming21-Jul-14 3:53
mveRichard Deeming21-Jul-14 3:53 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 23:34
vishavajeet21-Jul-14 23:34 
QuestionGiving input using App.config Pin
Mohan Subramani19-Jul-14 0:17
Mohan Subramani19-Jul-14 0:17 
Hello Guys,

Am developing an EXE for Coundowntimer functionality, I have used the below code for creating countdowntimer.

In Present Code: We need to give input for the "Time" and then start the timer in the output dialog
(Please refer the attached file)

Am planning to implement a app.config for Countdowntimer.exe, so that i can give my time directly in Countdowntimer.config and when i run my Countdowntimer.exe, the timer automatically will pick the time details given in Countdowntimer.config as input and start the timer.

my present code:

namespace countdownTimer
{
public partial class Form1 : Form
{
public int seconds; // Seconds.
public int minutes; // Minutes.
public int hours; // Hours.
public bool paused; // State of the timer [PAUSED/WORKING].

public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
if (paused != true)
{
if ((textBox1.Text != "") && (textBox2.Text != "") && (textBox3.Text != ""))
{
timer1.Enabled = true;
button2.Enabled = false;
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;


try
{
minutes = System.Convert.ToInt32(textBox2.Text);
seconds = System.Convert.ToInt32(textBox3.Text);
hours = System.Convert.ToInt32(textBox1.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
else
{
MessageBox.Show("Incomplete settings!");
}
}
else
{
timer1.Enabled = true;
paused = false;
button2.Enabled = false;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
// Verify if the time didn't pass.
if ((minutes == 0) && (hours == 0) && (seconds == 0))
{
// If the time is over, clear all settings and fields.
// Also, show the message, notifying that the time is over.
timer1.Enabled = false;
button2.Enabled = true;
textBox3.Clear();
textBox2.Clear();
textBox1.Enabled = true;
textBox3.Enabled = true;
textBox2.Enabled = true;
textBox1.Enabled = true;
lblHr.Text = "00";
lblMin.Text = "00";
lblSec.Text = "00";
}
else
{
// Else continue counting.
if (seconds < 1)
{
seconds = 59;
if (minutes == 0)
{
minutes = 59;
if (hours != 0)
hours -= 1;
}
else
{
minutes -= 1;
}
}
else
seconds -= 1;
// Display the current values of hours, minutes and seconds in
// the corresponding fields.
lblHr.Text = hours.ToString();
lblMin.Text = minutes.ToString();
lblSec.Text = seconds.ToString();
}
}
private void button3_Click(object sender, EventArgs e)
{
// Stop the timer.
paused = false;
timer1.Enabled = false;
button2.Enabled = true;
textBox3.Clear();
textBox2.Clear();
textBox1.Clear();
textBox1.Enabled = true;
textBox3.Enabled = true;
textBox2.Enabled = true;
textBox1.Enabled = true;
lblHr.Text = "00";
lblMin.Text = "00";
lblSec.Text = "00";
}
private void Form1_Load(object sender, EventArgs e)
{

}
}
}


Please suggest how do i provide a the input to the timer Hr: Min: Sec using app.config file.

-- modified 19-Jul-14 7:18am.
AnswerRe: Giving input using App.config Pin
dan!sh 20-Jul-14 19:26
professional dan!sh 20-Jul-14 19:26 
QuestionVirtual Drive in c# Pin
Bikash Panigrahi18-Jul-14 19:31
Bikash Panigrahi18-Jul-14 19:31 
AnswerRe: Virtual Drive in c# Pin
OriginalGriff18-Jul-14 21:33
mveOriginalGriff18-Jul-14 21:33 
AnswerRe: Virtual Drive in c# Pin
Eddy Vluggen18-Jul-14 22:24
professionalEddy Vluggen18-Jul-14 22:24 
AnswerRe: Virtual Drive in c# Pin
Dilan Shaminda19-Jul-14 0:05
professionalDilan Shaminda19-Jul-14 0:05 
QuestionMapping a class to a table that has two primary keys Pin
Member 128472117-Jul-14 17:32
Member 128472117-Jul-14 17:32 
GeneralRe: Mapping a class to a table that has two primary keys Pin
PIEBALDconsult17-Jul-14 18:29
mvePIEBALDconsult17-Jul-14 18:29 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Member 128472118-Jul-14 3:07
Member 128472118-Jul-14 3:07 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Eddy Vluggen18-Jul-14 3:27
professionalEddy Vluggen18-Jul-14 3:27 
AnswerRe: Mapping a class to a table that has two primary keys Pin
Karen Mitchelle17-Jul-14 19:31
professionalKaren Mitchelle17-Jul-14 19:31 
AnswerRe: Mapping a class to a table that has two primary keys Pin
Bernhard Hiller17-Jul-14 21:07
Bernhard Hiller17-Jul-14 21:07 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Member 128472118-Jul-14 3:04
Member 128472118-Jul-14 3:04 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Rob Philpott18-Jul-14 4:27
Rob Philpott18-Jul-14 4:27 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Member 128472118-Jul-14 4:37
Member 128472118-Jul-14 4:37 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Rob Philpott18-Jul-14 4:49
Rob Philpott18-Jul-14 4:49 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Eddy Vluggen18-Jul-14 5:13
professionalEddy Vluggen18-Jul-14 5:13 
GeneralRe: Mapping a class to a table that has two primary keys Pin
Member 128472118-Jul-14 6:37
Member 128472118-Jul-14 6:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.