Solved

inserting from DetailsView in insert mode using controlparameter

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp.net bundle 8 47
Convert to Hour/minute textbox and compare 3 52
Jquey and footrable 2 34
Ajax Panel Not Updating When Triggered By Timer 4 40
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

21 Experts available now in Live!

Get 1:1 Help Now