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
Nel
NA
716
1.1m
"No value given for one or more required parameters" error when working with tabcontrol
Feb 2 2012 5:58 AM
Hello,
I have a form with tabcontrol. I want depending on the value in the textBox in the form, to fill the datagridview in the tabcontrol. I wrote this code and got the error:"No value given for one or more required parameters"
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
dateTimePicker2.Focus();
OleDbCommand command3 = new OleDbCommand();
command3.Connection = conn;
command3.CommandText = "SELECT * from Avt where Brdog=?";
command3.Parameters.AddWithValue("@Brgod", textBox1.Text);
conn.Open();
DataSet1 _dataset = new DataSet1();
OleDbDataAdapter oleDbAdapter1 = new OleDbDataAdapter(new OleDbCommand(command3.CommandText, conn));
command3.ExecuteNonQuery();
_dataset.Clear();
oleDbAdapter1.Fill(_dataset, "Avt");
dataGridView1.DataSource = _dataset.Tables["Avt"].DefaultView;
conn.Close();
}
}
But I don't have an idea why I get this error when I give the parameter value in the bold sentence.
Can anybody help me please what could be the problem? Thanks
Reply
Answers (
5
)
How to upload multiple files on ftp server with different local network card IP Addresses
Help