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
Tharake Gunatilake
NA
53
73k
converting float values
Mar 15 2013 4:28 AM
I get data through a stores procedure from MS SQL db.
the values are,
int ID,
string name,
float distance..
i wrote this code in my c# DBAccess class.
rdr = com.ExecuteReader();
while (rdr.Read())
{
Merchant merchant = new Merchant();
merchant.ID = rdr.GetInt32(0);
merchant.name= rdr.GetString(1);
merchant.distance= rdr.GetFloat(2);
lstMerchant.Add(merchant);
}
but it gives me an exception "Specified cast is not valid."
This is given by "merchant.distance= rdr.GetFloat(2);" line...
What can i do??
please help me..Thank you.
Reply
Answers (
3
)
(Invoice Class)
xls to csv format