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
sourav adhikary
NA
69
21.5k
command parameter
Jun 18 2015 5:26 AM
Hi guys!
I done a project in c#... problem is in command parameter. my database is in access and all fields datatype is text.
my code is...
var dialogResult = MessageBox.Show("Are You want to Submit","Question",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
if (dialogResult == DialogResult.OK)
{
cmd = new OdbcCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "update brdans set ques='"+Ques_txt.Text+"',ans=@Ans where s_roll='" + Roll + "'";
cmd.Parameters.AddWithValue("@Ans", ans_txt.Text);
cmd.ExecuteNonQuery();
con.Close();
}
my error comes with message...
ERROR [07002] [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
thanks in advance
Reply
Answers (
2
)
Asynchronous Programming
how to see only two column of sqlCe database table in daGird