Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

inserting from DetailsView in insert mode using controlparameter

Posted on 2009-05-11
1
Medium Priority
?
1,459 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

718 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