473,840 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

No value given for one or more required parameters.

3 New Member
Hi,

The below error is what I am receiving. The code im using is below the error, for the life of me, I can not see where any parameter is missing.....

Server Error in '/FleetcubeNews' Application.
--------------------------------------------------------------------------------

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.

Exception Details: System.Data.Ole Db.OleDbExcepti on: No value given for one or more required parameters.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[OleDbException (0x80040e10): No value given for one or more required parameters.]
System.Data.Ole Db.OleDbCommand .ExecuteCommand TextErrorHandli ng(Int32 hr)
System.Data.Ole Db.OleDbCommand .ExecuteCommand TextForSingleRe sult(tagDBPARAM S dbParams, Object& executeResult)
System.Data.Ole Db.OleDbCommand .ExecuteCommand Text(Object& executeResult)
System.Data.Ole Db.OleDbCommand .ExecuteCommand (CommandBehavio r behavior, Object& executeResult)
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior behavior, String method)
System.Data.Ole Db.OleDbCommand .ExecuteNonQuer y()
FleetcubeNews.i nsert.addstory_ Click(Object sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
System.Web.UI.P age.ProcessRequ estMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2407; ASP.NET Version:1.1.432 2.2407

Private Function uploadFile() As Boolean

Dim path As String = Server.MapPath( "~") & "/assets/images/"
Dim fileOK As Boolean = False

Dim fileExtension As String = System.IO.Path. GetExtension(up load.PostedFile .FileName).ToLo wer()
Dim allowedExtensio ns As String() = {".jpg", ".jpeg", ".png", ".gif"}

For i As Integer = 0 To allowedExtensio ns.Length - 1
If fileExtension = allowedExtensio ns(i) Then

fileOK = True

End If

Next

If fileOK = True Then

' Try

'upload.PostedF ile.SaveAs(path & upload.PostedFi le.FileName)

' upload.PostedFi le.SaveAs("/FleetcubeNews/assets/images/" & upload.PostedFi le.FileName)

upload.PostedFi le.SaveAs(path & System.IO.Path. GetFileName(upl oad.PostedFile. FileName))

' Return True

' Catch ex As Exception

' Response.Write( "<b>File could not be uploaded.</b><br/>")

' Return False

' End Try

' Else

' Response.Write( "<b>Cannot accept files of this type.</b><br/>")

' Return False

End If

End Function

Private Sub addstory_Click( ByVal sender As System.Object, ByVal e As System.EventArg s) Handles addstory.Click
If headline.Text.L ength > 0 AndAlso intro.Text.Leng th > 0 AndAlso story.Text.Leng th > 0 AndAlso start.Text.Leng th > 0 Then

'insert

Dim er As Boolean

Dim conn As New OleDb.OleDbConn ection(System.C onfiguration.Co nfigurationSett ings.AppSetting s.Get("newsConn "))
Dim com As New OleDb.OleDbComm and

'dim qs as String = ""

com.CommandText = "insert into story(headline, intro, story, typeid, makeid, start) " _

& "values(?,?,?,? ,?,?)"

com.Connection = conn

com.Parameters. Add("@h", OleDb.OleDbType .VarChar).Value = headline.Text

com.Parameters. Add("@i", OleDb.OleDbType .VarChar).Value = intro.Text

com.Parameters. Add("@s", OleDb.OleDbType .VarChar).Value = story.Text

com.Parameters. Add("@t", OleDb.OleDbType .Integer).Value = type.SelectedVa lue

com.Parameters. Add("@m", OleDb.OleDbType .Integer).Value = make.SelectedVa lue

com.Parameters. Add("@d", OleDb.OleDbType .Date).Value = start.Text

'Dim ps As String

If upload.Value <> "" Then

com.CommandText = "insert into story(headline, intro, story, typeid, makeid, start, path) " _

& "values(?,?,?,? ,?,?,?)"

'upload, then return filename

If uploadFile() Then

Response.Write( "ss" & upload.PostedFi le.FileName)

com.Parameters. Add("@p", OleDb.OleDbType .VarChar).Value = upload.PostedFi le.FileName

Else

' top.Text = "An error has ocurred. Please try again.<br/>(upload failed)"

End If

End If


' Try

com.Connection. Open()

com.ExecuteNonQ uery()

' Catch ex As Exception

' Response.Write( ex.Message)

' er = True

' End Try

com.Connection. Close()

If Not er Then

addstory.Enable d = False

top.ForeColor = System.Drawing. Color.Blue

top.Text = "The story has been added."

Else

top.Text = "Please try again."

End If

Else

top.Text = "All fields are required."

End If

End Sub



I thank you for any assistance given :)

From a friend in need
Oct 17 '07 #1
0 4615

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1162
by: Jo | last post by:
Hello, can someone help me? This is the code that I use: Dim rsSelectMandaten As New ADODB.Recordset Set rsSelectMandaten.ActiveConnection = DEData.CnnConnection rsSelectMandaten.CursorLocation = adUseClient
7
6254
by: mp | last post by:
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. Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters. Source Error:
3
8843
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application. ---------------------------------------------------------------------------- ----
3
11783
by: Grayscale | last post by:
Hello, When I execute the code below, I get: "Microsoft JET Database Engine (0x80040E10) No value given for one or more required parameters." error message in the first line. Rs.Open "SELECT * From Unvanlar WHERE Unvan = " & kayit8, Con, 3,3 If rs.EOF Then
1
5328
by: Georges | last post by:
Hi! Could someone help? I'm having trouble with the following code. Everythig goes fine till the last line where I'm trying to update the datasource. The program stops executing and displays the message "No value given for one or more required parameters." I tried many ways of doing the same, nothing works. Public Class FormX
15
16079
by: Dave | last post by:
I am getting the error above intermittantly with an ASP 3.0 page using an MS Access 2003 database. I have searched Google extensively and found the following possible causes for this error: A field name was spelled incorrectly. One or more of the values was blank. You tried to insert the wrong datatype (e.g. surrounded a numeric value with quotes, or forgot to put quotes around a string).
0
2433
by: Gwen Crutcher | last post by:
I keep getting the error "No value given for one or more required parameters", but not sure why. Can anyone please look at my code snipet and see if you see any reason why I could be getting this error. I am just trying to update a record using MS Access 2003 as the front end. This code is in VB.NET Private Sub cmdUpdate_Click() On Error GoTo Err_cmdUpdate_Click Dim rstUsers As New ADODB.Recordset
0
9699
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10603
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9440
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7838
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7023
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
4076
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.