Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > what's wrong with this parameter?

Reply
Thread Tools

what's wrong with this parameter?

 
 
André
Guest
Posts: n/a
 
      06-24-2006
Hi,

I made a detailsview for inserting data in the table.
I also made a dropdownlist which the selected value must be used for one of
the field in the detailsview.
In the <InsertParameters> tag, i removed the parameter 'lo' because i added
it from code-behind.
I put the 'DataKeyNames' as the primary key of the table in detailsview.

My problem is:
"No value given for one or more required parameters"

In aspx, i did:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConflictDetection="CompareAllValues"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data
Source=c:\mytable.mdb"
....
InsertCommand="INSERT INTO [pc] ([na], [deft], [lo]) VALUES (?, ?, @lo)"
OldValuesParameterFormatString="original_{0}"
ProviderName="System.Data.OleDb"
<InsertParameters>
<asparameter Name="na" Type="String" />
<asparameter Name="deft" Type="Boolean" />
</InsertParameters>

If i add this, it works (but still with this value)
<asparameter Name="anything" DefaultValue="1-45" Type="String" />

code-behind:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Dim lo As String
lo = DropDownList1.SelectedValue
SqlDataSource1.InsertParameters.Add("lo", lo)
End Sub


What did i not see?
Thanks for help
André


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Have I bought wrong product? enquirer Wireless Networking 2 06-10-2005 10:59 PM
Zero Config keeps connecting to the wrong AP =?Utf-8?B?ZGdyaWZmaXRo?= Wireless Networking 2 03-04-2005 05:52 PM
Is XML Doc wrong or is Schema wrong? (or both) Matthew XML 7 01-07-2005 10:05 PM
wrong connection status Peter Welk Wireless Networking 0 12-22-2004 03:26 PM
XP SP2 Wrong IP on connection D Wells Wireless Networking 3 12-09-2004 03:35 AM



Advertisments