Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert/Update data from DetailsView using SQL view in DataSource 1

Status
Not open for further replies.
Aug 11, 2004
53
CA
Hi all,

I'm working with VisualStudio2K5 using the VWD interface. What I'm attempting is the following:

I have two SQL tables, One containing Vendor info, and one containing lookup information for Vendor Terms. There is a column in Vendor that contains the primary key for the appropriate record in the Vendor Terms table. I have established the appropriate relationship between the two tables in SQL.

Now, what I'd like to do on my ASP page, is have a GridView which displays only a few crucial fields from the Vendor table, and then have a DetailsView or FormView that displays the complete information from the Vendor table for whatever record is selected on the GridView, as well as allowing for Inserting, Editing and Deleting within that DetailsView or FormView.

So, I've created an SQL datasource for the Gridview pointing to the SQL view of both complete Vendor and VendorTerms tables.
Then, I've created a second SQL datasource that grabs the single record that is selected in the Gridview and connected it to the Formview.

This is where I run into problems. I would love to be able to edit info in this FormView for existing records, but I obviously want to have the lookup capability when I'm choosing my VendorTerms so I can see the descriptive column from the VendorTerms table in my drop down list rather than the PrimaryKey integer value.

I thought I could do this by simply recreating the control in FormView for my VendorTerms as a drop down, doing the appropriate data binding and changing of column visible in the drop down list. This would be great except that my FormView Datasource will not allow me to select the "Update,Insert, etc." check box in the Advanced window of it's properties.

Can anybody out there tell me where I'm going wrong and lead me in the right direction?

Thanks,
Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top