.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

incorrect format when import excel to table

Posted By: Catherine     Posted Date: June 10, 2011    Points:5   Category :Sql Server
hi I am import excel field to database table but in my table. the account number field is not correct format in my database table like this coming 5.001e+011. I have changed in excel account column format in number but error coming

Responses
Author: SureshM             
Posted Date: June 10, 2011     Points: 20   

Hi Catherine ,

I hope this will help you, try this.

using System.Globalization;// need to use the namespace.

string s = "5.001e+011"; //Here, you have to assign the Value which is retrieved from your excel file.
decimal amount1;
decimal.TryParse(s, NumberStyles.Any, null, out amount1);

Then you can store the " amount1 " into your database table.



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend