Solved

inserting from DetailsView in insert mode using controlparameter

Posted on 2009-05-11
1
1,454 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now