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
Israel
699
1.3k
217.3k
the meaning of this: "IndexOutOfRangeException was unhandle"
Apr 29 2014 11:25 AM
Hi!
I am doing a simple filter after that my records should appear on textboxs I choose. But its appear only on the one I colored on blue (other one not. Why?)
I thought that its was the type of the "stocks" column. Before its was type="numeric" . I change to "nchar". But Still giving me this error
"IndexOutOfRangeException was unhandle".
private void btnProcurarProdutoCons_Click(object sender, EventArgs e)
{
string connectionString = @"Data Source=localhost\sqlexpress;Initial Catalog=master;Integrated Security=True";
SqlConnection sqlCon = new SqlConnection(connectionString);
sqlCon.Open();
string commandString = "select produto from consultoria where produto='" + nomeProdutoConsStocks.Text + "'";
SqlCommand sqlCmd = new SqlCommand(commandString, sqlCon);
SqlDataReader read = sqlCmd.ExecuteReader();
while (read.Read())
{
produtoStocks.Text = read["produto"].ToString();
// Here its appear
nStocksStocks.Text = read["n_stocks"].ToString();//Here its not appear
}
sqlCon.Close();
}
Reply
Answers (
2
)
Any Rule Is There That only one form should be open????
Good information maybe for every developer