Solved

inserting from DetailsView in insert mode using controlparameter

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

20 Experts available now in Live!

Get 1:1 Help Now