TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vinod jangir
NA
114
9.1k
how to cnvert string to int for date???
Sep 30 2015 5:00 AM
public int T_Date = 0;
private void addToolStripMenuItem_Click(object sender, System.EventArgs e)
{
try
{
DataColumn col = new DataColumn((dataGridView1.ColumnCount + 1).ToString());
//T_Date = System.DateTime.Now.ToString("dd.MM.yyyy");
//DateTime now = System.DateTime.Now;
T_Date = Convert.ToInt32(DateTime.Now);
dataGridView1.Columns.Add("Column", "T_Date");
if (dataGridView1.ColumnCount >0)
{
T_Date = 1;
}
else
{
T_Date = T_Date + 1;
}
dataGridView1.Columns[dataGridView1.RowCount - 1].CellType.IsValueType.GetType();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
following error found
Invalid cast from 'DateTime' to 'Int32'.
Reply
Answers (
4
)
database conecting c# 2015
Transfer data from mutiple csv to single excel workbook