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
Danish Habib
NA
694
244k
Reading datetime in sqlite
Oct 19 2015 3:16 AM
I have a desktop application in which i am saving the user with datetime
while saving my table datatype is datetime
i am saving like that
com.Parameters.Add("@CreateDate", SqlDbType.DateTime).Value = _create.ToString("dd/MMM/yyyy");
while reading i am using that code
sql_cmd.CommandText = "SELECT UserName, IsNever, CreateDate, ValidDays, ExpireDate FROM Users WHERE (UserID = @UserID) AND (UserPassWord = @UserPassWord)";
sql_cmd.Parameters.Add("@UserID", SqlDbType.NVarChar).Value = UserID.ToString().Trim();
sql_cmd.Parameters.Add("@UserPassWord", SqlDbType.NVarChar).Value = PassWord.ToString().Trim();
rdr = sql_cmd.ExecuteReader();
while (rdr.Read())
{
objClsUsers = new ClsUserLoging();
objClsUsers.UserName = rdr.GetString(0).ToString();
objClsUsers.Never = rdr.GetBoolean(1);
objClsUsers.CreateDate = rdr.GetDateTime(2);
objClsUsers.ValidDays = (short)rdr.GetInt32(3);
objClsUsers.ExpireDate = rdr.GetDateTime(4);
}
rdr.Close();
it gives exception on the highlited line that "
Invalid DateTime Field Format: 19/Oct/2015"
anyone can assists me in that regard Thanks in advance
Reply
Answers (
1
)
Merging Columns in "about grid view" from database
mobile menu not working