Re: No value given for one or more required parameters

From: mp (plamir_at_volja.net)
Date: 04/01/04


Date: Thu, 1 Apr 2004 16:29:17 +0200

No this is not pubs from SQL 2000. It is my own MS access database with
"same" table inide. I am not sure is the same but all columns are text type.
There is no required filelds.

Thanks

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:e4PQ4P$FEHA.3856@TK2MSFTNGP12.phx.gbl...
> mp,
> Since this looks like pubs from SQL 2000 you have three more
'required'
> fields to fill in as au_fname, phone, and contract are specified as NOT
NULL
> and do not have default values. So the insert will be rejected as
violating
> table constraints.
>
> Ron Allen
> "mp" <plamir@volja.net> wrote in message
> news:Oz02kv%23FEHA.1368@TK2MSFTNGP11.phx.gbl...
> > Thanks Jon.
> > I understand but look this.
> > When i use following line of code
> > String insertCmd = "insert into Authors (au_id, au_lname) values (@Id,
> > @LName)";
> >
> > OleDbCommand myCommand = new OleDbCommand(insertCmd, thisConnection);
> >
> > myCommand.Parameters.Add(new OleDbParameter("@Id", OleDbType.VarChar,
> 11));
> >
> > myCommand.Parameters["@Id"].Value = txtID.Text;
> > /*Server.HtmlEncode(txtID.Text);*/
> >
> > myCommand.Parameters.Add(new OleDbParameter("@LName", OleDbType.VarChar,
> > 40));
> >
> > myCommand.Parameters["@LName"].Value = txtLName.Text; /*
> > Server.HtmlEncode(txtLName.Text); */
> >
> >
> > myCommand.Connection.Open();
> >
> > myCommand.ExecuteNonQuery();
> >
> > Error is:
> >
> > Operation must use an updateable query.
> > Description: An unhandled exception occurred during the execution of the
> > current web request. Please review the stack trace for more information
> > about the error and where it originated in the code.
> >
> > Exception Details: System.Data.OleDb.OleDbException: Operation must use
an
> > updateable query.
> >
> > Why this query is not updateable?
> >
> > Thanks
> >
> >
> >
> >
> > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > news:MPG.1ad6240c9764e1ee98a541@msnews.microsoft.com...
> > > mp <plamir@volja.net> wrote:
> > > > No value given for one or more required parameters.
> > > > Description: An unhandled exception occurred during the execution of
> the
> > > > current web request. Please review the stack trace for more
> information
> > > > about the error and where it originated in the code.
> > >
> > > <snip>
> > >
> > > > Code is following:
> > > > ...
> > > > String insertCmd = "insert into Authors (au_id, au_lname, au_fname,
> > phone,
> > > > address, city, state, zip, contract) values (@Id, @LName, @FName,
> > @Phone,
> > > > @Address, @City, @State, @Zip, @Contract)";
> > > >
> > > > OleDbCommand myCommand = new OleDbCommand(insertCmd,
thisConnection);
> > > >
> > > > myCommand.Parameters.Add(new OleDbParameter("@Id",
OleDbType.VarChar,
> > 11));
> > > >
> > > > myCommand.Parameters["@Id"].Value = txtID.Text;
> > > > /*Server.HtmlEncode(txtID.Text);*/
> > > >
> > > > myCommand.Parameters.Add(new OleDbParameter("@LName",
> OleDbType.VarChar,
> > > > 40));
> > > >
> > > > myCommand.Parameters["@LName"].Value = txtLName.Text; /*
> > > > Server.HtmlEncode(txtLName.Text); */
> > > >
> > > >
> > > > myCommand.Connection.Open();
> > > >
> > > > myCommand.ExecuteNonQuery();
> > >
> > > Well, you've specified 9 parameters in the query, and only filled in
> > > values for 2 of them. What did you expect to happen about the other 7?
> > >
> > > --
> > > Jon Skeet - <skeet@pobox.com>
> > > http://www.pobox.com/~skeet
> > > If replying to the group, please do not mail me too
> >
> >
>
>



Relevant Pages

  • Re: No value given for one or more required parameters
    ... Since this looks like pubs from SQL 2000 you have three more 'required' ... fields to fill in as au_fname, phone, and contract are specified as NOT NULL ... > Operation must use an updateable query. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: sp_fulltext_table with SQL Server Agent - permissions problem?
    ... SQL Server Scheduled Job 'hm_build_ft' ... I have tried to create SQL FTS on the pubs database but the problem is the ... >> USE hm2 ...
    (microsoft.public.sqlserver.fulltext)
  • Re: SQL connection problem
    ... EXEC sp_defaultdb 'John', 'pubs' ... Detach the database and delete the LOG file. ... > I have sql 2000. ...
    (microsoft.public.sqlserver.programming)
  • Re: need help
    ... for both my db and the pubs db which the code works ... I did change my sql to thi: ... dbo.Task.comments FROM dbo.Team INNER JOIN dbo.Task ON ... Is the SQL Server you are hitting a local ...
    (microsoft.public.dotnet.languages.csharp)
  • Update all fields
    ... >I get an error message "Must be an updateable query for ... >the following SQL: ... >from Table1 Where Month_name is not null) ...
    (microsoft.public.access.queries)