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
Violeta Popa
NA
137
164k
dataReader doesn't read
Apr 16 2013 4:05 PM
Hi :) I am trying to read some information from the database, but i don't know why this reader doesn't work. I've checked in the database and i have the client with that id.
int nr_dauna = 0;
string selectDauna = "SELECT * FROM dauna WHERE id_client='" + 16 + "'";
SqlCommand executaSelectDauna = new SqlCommand(selectDauna, conn);
SqlDataReader rdr_dauna = executaSelectDauna.ExecuteReader();
rdr_dauna.Read();
nr_dauna = Convert.ToInt32(rdr_dauna["nr_dauna"]);
rdr_dauna.Close();
MessageBox.Show(nr_dauna.ToString());
It's sth wrong? Or maybe there is another way of reading database info?Thanks!
Reply
Answers (
5
)
Bullets in RichTextBox
Textbox to label