What is mean System.format exception
input string is not in correct format exception means what?how i resolve it?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dorababu MekaRank #457 · 5.5K reputationPosted Apr 22, 2011, 2:15 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 22, 2011, 2:54 AM EDT
string s = "Hello";
int i = Convert.ToInt32(s);
// or
string s = "1000000";
DateTime dt = DateTime.Parse(s);
However, it's not confined to these situations and can be thrown more generally when a method argument is simply not in the format which the method expects.
To resolve it, make sure that the argument is in an appropriate format (read the docs if unsure) before you pass it.
Ankit NandekarRank #703 · 3.4K reputationPosted Apr 22, 2011, 3:37 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Apr 22, 2011, 3:15 PM EDT
Mahesh ChandRank #1 · 393.3K reputationPosted Apr 22, 2011, 6:55 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Apr 25, 2011, 6:28 AM EDT
shree gunjal59 reputationPosted Apr 25, 2011, 11:43 PM EDT
when 1st list item selected ,then in another dropdownlist company name as items which belongs inthat company group must arrive.for that i write query in selected indexchanged of 1st dropdown list.and kept Autopostback=true .it work properly.
but my problem is when i select 2nd list i.e company list item than i want a companyid in one textbox
so that i write query in 2nd dropdownlist selected index change
please see code
VulpesRank #55 · 29.2K reputationPosted Apr 26, 2011, 1:45 AM EDT
However, there are some companyids already in the database which are not integers but strings (say "C01") and so the Int32.ToString() method, which is getting called at runtime, is having a problem because it's trying to parse an integer to a string - hence the format exception.
shree gunjal59 reputationPosted Apr 27, 2011, 6:17 AM EDT
autoincrement property is false.because for that i write code.
so what can i do next?
VulpesRank #55 · 29.2K reputationPosted Apr 27, 2011, 7:04 AM EDT