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
sadhana sawant
NA
7
1.1k
i am trying to fetch customer address from database on selec
Feb 6 2015 3:20 AM
here is my code:
private void cmbCustomer_SelectedIndexChanged(object sender, EventArgs e)
{
//id = Convert.ToInt64(cmbCustomer.SelectedValue);
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand("select * from RM_Customer where custID ='"
+Convert.ToInt64(cmbCustomer.SelectedValue) +
"'", cn);
cn.Close();
cn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
txtaddress.Text = dr["custAddress"].ToString();
}
dr.Close();
cn.Close();
}
i got error like this:
Unable to cast object of type 'System.Data.DataRowView' to type 'System.IConvertible'
Reply
Answers (
4
)
ListBox control
Merge two DataTables