Solved

inserting from DetailsView in insert mode using controlparameter

Posted on 2009-05-11
1
1,457 Views
Last Modified: 2012-05-06
Hi,

I am trying to insert from DetailsView  on insert mode using the controlparameters of my dropdownlist and textbox.

I used the same code several times before and they are still working fine.
But this one is not working at  all.
I don't know how to debug it.

Bascially I have one DetailsView form with, say, one textbox and one dropdownlist for name and title(in dropdownlist)

It is not inserting anything.
<DetailsView id=DetailsView1
  <fields>
      <templateField>
 
<asp:SqlDataSource ID="SqlDataSource3  ...
InsertCommand="insert into table (lastname,title) values (@last name,@title)
<InsertParameters>  
    <asp:controlparameter controlid=DetailsView1$TextBox name="lastname" PropertyName="Text" Type="String">
<asp:controlparameter controlid=DetailsView1$DropDownList1" name="title" PropertyName="SelectedItem" Type="String">
</asp:SqlDataSource>

Open in new window

0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
dkim18 earned 0 total points
ID: 24355814
I got it working.

in <asp:ControlParameter > I put Direction=input and it worked.
I didn't use it before and worked fine and I wonder why it didn't like it this time.

Another question,
In dropdownlist, it didn't like the space in value.
<asp:dropdownlist>
<asp:listitem value="Male Type1//Tall Type2 //Status 2">Male Type1//Tall Type2 //Status 2</>
Because of that space in value, I got OBJECT MUST IMPLEMENT ICONVERTIBLE.
Can someone explain that to me please?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question