473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

DrowDownList inside a FormView

Hi, I need help:
I have a FormView control on the page, for managing Download Section on a web site. The download section has a list of categories (here is where DropDownList comes in). The DropDownList is binded to a AccessDataSource, which extracts the ID and name of a category (id is used for a file/category).
For some reason, my code returns an error
Expand|Select|Wrap|Line Numbers
  1. Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.
when I try to insert a record.

Here is the ASP.NET template for <InsertTemplate>

Expand|Select|Wrap|Line Numbers
  1. <td style="border: 1px solid #000000;">
  2.                                                                             <b>Category:</b></td>
  3.                                                                         <td style="border: 1px solid #000000;">
  4.  
  5.                                                                             <asp:DropDownList ID="kindDropDownList" runat="server" DataSourceID="dbCategories"
  6.                                                         DataTextField="category_name" DataValueField="kind" Width="323px" SelectedValue='<%# Bind("kind") %>' >
  7.                                                     </asp:DropDownList>
  8.                                                                         </td>
  9.  
Please help. =\
Aug 1 '07 #1
2 1090
Hi, I need help:
I have a FormView control on the page, for managing Download Section on a web site. The download section has a list of categories (here is where DropDownList comes in). The DropDownList is binded to a AccessDataSource, which extracts the ID and name of a category (id is used for a file/category).
For some reason, my code returns an error
Expand|Select|Wrap|Line Numbers
  1. Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.
when I try to insert a record.

Here is the ASP.NET template for <InsertTemplate>

Expand|Select|Wrap|Line Numbers
  1. <td style="border: 1px solid #000000;">
  2.                                                                             <b>Category:</b></td>
  3.                                                                         <td style="border: 1px solid #000000;">
  4.  
  5.                                                                             <asp:DropDownList ID="kindDropDownList" runat="server" DataSourceID="dbCategories"
  6.                                                         DataTextField="category_name" DataValueField="kind" Width="323px" SelectedValue='<%# Bind("kind") %>' >
  7.                                                     </asp:DropDownList>
  8.                                                                         </td>
  9.  
Please help. =\
hi, are you passing all the parameters to be inserted into your table?
if you have the id field as autoincrement, then also you might have to pass null.
or you can try giving "allow null" in the table design if not all fields are to be inserted.
Aug 1 '07 #2
hi, are you passing all the parameters to be inserted into your table?
if you have the id field as autoincrement, then also you might have to pass null.
or you can try giving "allow null" in the table design if not all fields are to be inserted.
ok, thank you, it worked!
Aug 2 '07 #3

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

Similar topics

2
by: John R. Lewis | last post by:
I posted this yesterday with a different email address. I am reposting with my fake-address as given to me by Microsoft so that I can be guraranteed a response from a support representative. Sorry...
6
by: Douglas J. Badin | last post by:
Earlier this month, there was a posting about this without a definitive answer. If you place a Wizard inside a FormView's EditItemTemplate the bound fields contained within the View will display...
2
by: Ned Balzer | last post by:
I'm trying to create a formview bound to a sqldatasource, and use a stored procedure to insert data from the formview into several tables. I have some simplified code below, the real code is much...
2
by: wikkiwikkiwaa | last post by:
hello, i am trying to access controls inside my formview1 nested inside loginview1. you cannot access the formview1 unless you are properly logged in. for loginview1, that seems to be fairly...
0
by: Jai | last post by:
Hi, Somebody please tell me how to bind(two way) a checkboxlist with objectdatasource if the checkboxlist is inside a formview..... Code of FormView is like this::--- <asp:FormView...
0
by: Jai | last post by:
Hi, Somebody please tell me how to bind(two way) a checkboxlist with objectdatasource if the checkboxlist is inside a formview..... Code of FormView is like this::--- <asp:FormView...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
1
by: Brad Baker | last post by:
I have created a usercontrol (ascx file) which contains a formview, inside of the formview I have an EditItemTemplate and an ItemTemplate. Both the EditItemTemplate and ItemTemplate have link...
2
by: =?Utf-8?B?Q29sb3JzdG9uZQ==?= | last post by:
Hi, I have a TabContainer inside a data bound FormView (to logically group the form fields into different tabs). The display part of the data binding works fine, but the Update doesn't. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.