Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DropDownList in ASP.NET Gridview Not Saving Changes Made During UPDATE

Posted on 2013-06-26
2
Medium Priority
?
633 Views
Last Modified: 2013-07-02
I've taken a gridview and replaced several of the fields with dropdownlists.

The Gridview is bound to a SQLDataSource and the dropdownlists are bound to a different SQLDataSource.  Generally I autoload all of the lookup table values into a dataset on page_load and bind my controls to the specific tables in the dataset.  The problem I'm having is because the ddls are inside of the gridview and I can't figure out why the selectedvalue  isn't being saved when I click on the UPDATE button.  It's wasn't originally throwing an exception it's just wasn't saving.  Now it's throwing an exception stating it "Cannot insert the value NULL".  Column does not allow nulls.

Where should I begin troubleshooting this?
0
Comment
Question by:Mariyam
[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
2 Comments
 
LVL 12

Accepted Solution

by:
duttcom earned 1080 total points
ID: 39280186
Ideally, you should have placed the ddls for editing the data inside an EditTemplateItem inside a template field in the Gridview.

This is a good walkthrough of implementing ddls in a gridview for editing -

http://msdn.microsoft.com/en-us/library/ms178294(v=vs.80).aspx
0
 

Author Closing Comment

by:Mariyam
ID: 39292362
The link you referenced is the exact one I used for testing - the problem for me seems to be that since the data that populates the ddls comes from tables different than the gridview sqlds table.

I got it working in 2005, but still no go on 2010.  I'm going to go ahead and complete the framework in 2005 and once it's table see about what advantages vs2010 offers (like AJAX for example).

Thanks so much.
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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

721 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