C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to validate datetimepicker in windows application


Posted Date: 02 Sep 2008      Total Responses: 5

Posted By: Maheswari       Member Level: Gold     Points: 1


in windows application

i have datetimepicker and datagridview.

while selecting date from datetimepicker data retrieved from database and display into datagridview.if data is not in database of selected data it comes error message.it works correctly.

but if i click previous month i could not select date because while clicking previous month (database doesn't have value) it comes error continuously.

i need to avoid this continuous error.bcz i need to select previous month with date also.

how to solve this problem.

thanks in advance


mahi.




Responses

Author: kingfisher    02 Sep 2008Member Level: SilverRating:     Points: 1
can u please tell what is the error u get?


Author: Athira Appukuttan    02 Sep 2008Member Level: DiamondRating:     Points: 1
Please send me u r code.Also tell me what error u r getting through that code?


Author: sweety    02 Sep 2008Member Level: GoldRating:     Points: 2
hello
on selection of datepicker just assign default current date to it

This will allow to to change the date

Regards


Author: Rekha    02 Sep 2008Member Level: GoldRating:     Points: 1
Would u please get us clear on your error. So that we can provide the solution for ur problem. If may also problem in the query also. Let us know ur coding

Regards


Author: Maheswari    02 Sep 2008Member Level: GoldRating:     Points: 6
private void dtp_Edit_ValueChanged(object sender, EventArgs e)
{
dgv_Edit.Columns.Clear();
try
{
if (dtp_Edit.Visible == true)
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
else
{
con.Open();
string dt = dtp_Edit.Value.ToString("dd/MM/yyyy");
Cls_DailyEntry LoadTodayExpense = new Cls_DailyEntry();
LoadTodayExpense.TODAYDATE = dt;
TCM_LoadUtility tcmdailyentryselect = new TCM_LoadUtility();
DataSet ds = tcmdailyentryselect.DailyEntrySelectExpense(LoadTodayExpense);
if ((ds.Tables[0].Rows.Count != 0) && (ds.Tables[0].Rows.Count > 0))
{
dgv_Edit.DataSource = ds.Tables[0];
dgv_Edit.Columns[3].Visible = false;
}
else
{
MessageBox.Show("No Details found for this Date", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Cls_DailyEntry LoadTodayExpenseTotal = new Cls_DailyEntry();
LoadTodayExpenseTotal.TODAYDATE = dt;
TCM_LoadUtility tcmdailyentryselecttot = new TCM_LoadUtility();
DataSet ds1 = tcmdailyentryselecttot.DailyEntrySelectExpenseTotal(LoadTodayExpenseTotal);
if ((ds1.Tables[0].Rows.Count != 0) && (ds1.Tables[0].Rows.Count > 0))
{
DataTable dt1 = ds1.Tables[0];
foreach (DataRow dr in dt1.Rows)
{
txt_DailyTotal.Text = dr["Total"].ToString();
}
}
else
{

}
con.Close();
}

}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}



Post Reply
You must Sign In to post a response.
Next : Windows Scheduler
Previous : Hit count for windows application
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

Help Desk

Contact Us    Privacy Policy    Terms Of Use