discocarp Posted September 24, 2003 Posted September 24, 2003 Can somebody tell me why this doesn't work and what the correct way to get a value from the database is? DataRowView r=data_view[recnum]; label1.Text=r.Row["Name"]; Thanks Peter Quote
*Experts* Nerseus Posted September 24, 2003 *Experts* Posted September 24, 2003 What's wrong with what you have? Does it throw an exception, give you the wrong data, or something else? -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
discocarp Posted September 25, 2003 Author Posted September 25, 2003 It won't compile. I'm at home now, tomorrow I'll post the exact error. Thanks for your time! Peter Quote
discocarp Posted September 25, 2003 Author Posted September 25, 2003 I get the following compile error on the line label1.Text=r.Row["Name"]; Cannot implicitly convert type 'object' to 'string'. Peter Quote
discocarp Posted September 25, 2003 Author Posted September 25, 2003 I figured it out. The line should be: label1.Text=(string)r.Row["Name"]; Peter Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.