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
ancy chacko
NA
71
18.4k
Error in Autogenerating empcode in asp.net
Feb 18 2015 1:03 AM
i want autogenerating empcode.
k001..k002,k003
error:::
Input string was not in a correct format.
cn.open();
int r;
string str = "select MAX(empcode) from tbl_organization1";
MySqlCommand cmd = new MySqlCommand(str, cn);
MySqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
string a = dr[0].ToString();
if (a == "")
{
lblempcode.Text = "K" + 001;
}
else
{
string v = a.TrimStart('K');
r = Convert.ToInt32(v);
r = r + 1;
string strtt = "K" + string.Format("{0:000}",r); ;
lblempcode.Text = strtt.ToString();
// = strtt + 1;
}
cn.Close();
}
}
Reply
Answers (
3
)
ado.net
How To Sum Value Of Gridview Column In C#.net (Win App)