Showing table columns from multiple tables in Formview, but insert/update/delete rows of Master table

I have a page on which I have GridView and FomView control. On selection of a row in GridView the row gets displayed in the Item template of the FormVIew. The values are the result of inner join from multiple tables

i.e. table Stock,Product and Workshop. 

Please let me know how I could insert/update/delete data for the base table i.e. Stock table, but be able to see the column values from the associated tables on the Itemtemplate,Edittemplate and Inserttemplate of the FormView.

Thanks,
Anita

0
amallick
9/24/2007 10:45:17 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

4 Replies
1920 Views

Similar Articles

[PageSpeed] 53

Hi:

  Take a look at this tutorial. It's for DetailsView and same table but the idea is same. You just have to change the command of SqlDataSource3.

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/detailsview.aspx

VB Master-Details w/ GridView and DetailsView
Run Sample View Source
  If it's not what you need, please inform us.
 
Regards

 

 


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
9/26/2007 1:28:48 AM

Hi Allan,

Thanks for your reply. The tutorial answers my issue.

I have created a page with Gridview and Formview having SqlDatasource with data as a result of table join, but I am having difficulty updating and deleting data in the FormView, The Insert feature works fine.

How can I enable optimistic concurrency if I don't create Sqldatasource using wizard.

Thanks,
Anita 

 

 

0
amallick
9/26/2007 3:33:34 PM

Hi:

 

amallick:
but I am having difficulty updating and deleting data in the FormView,

 

  I would use Stored Procedure. Have you tried that?

<asp:SqlDataSource UpdateCommandType="StoredProcedure" ..

VB GridView-SqlDataSource (Stored Procedure)
Run Sample View Source

amallick:
How can I enable optimistic concurrency if I don't create Sqldatasource using wizard.

  I'm not sure what do you mean by this. Do you mean you don't want to use SqlDataSource?

  Regards


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
9/27/2007 1:24:25 AM

Hi Allen,

[ I would use Stored Procedure. Have you tried that?]

I will try using Stored Procedures.

[I'm not sure what do you mean by this. Do you mean you don't want to use SqlDataSource?]

I wrote the select statement in the code itself using tag  <asp:SqlDataSource> without pulling in the SqlDataSource control onto the form and configuring it.

Thanks.
Anita

 

 

 

0
amallick
9/27/2007 10:20:48 PM
Reply:

Similar Artilces:

Deleting Child Table Rows and not from the master table using SqlDataAdapter.Update()
I have two tables tblPerson and tblPhone. tblPerson has: PersonID Name tblPhone has: PhoneID PersonID PhoneNumber I am using SqlDataAdapter.Update to delete the rows from the tables. I am also using Typed DataSets and the relation between the two tables depends upon the PersonID. When I delete from the tblPerson the corresponding record of that person is also deleted from the tblPhone which is good. When I try to delete from the tblPhone I dont want the Person record to be deleted and it throws exception:  Failed to enable constraints. One or more rows contain ...

Is having a trigger that inserts a row in Table 'A', when a row in same table is inserted by ADo.Net code?
I want to insert a row for a Global user  in Table 'A' whenever ADO.Net code inserts a Local user row into same table. I recommended using a trigger to implement this functionality, but the DBA was against it, saying that stored proecedures should be used, since triggers are unreliable and slow down the system by placing unecessary locks on the table. Is this true OR the DBA is saying something wrong? My thinking is that Microsoft will never include triggers if they are unreliable and the DBA is just wanting to offload the extra DBA task of triggers to the programmer so that a s...

How to insert into two tables at (Master table and Detail table)
I was hoping that the asp.net/learn/dataaccess would have had a tutorial for inserting into a MasterRecord and DetailRecord.  I have a page that I am working on that is a Reciepe. The Master Record has details such as customer, mix name, create date. The Detail Records has Ingredient Name, Ingredient Amount, etc. I have been following the DAL and BLL concept of the asp.net/learn/dataccess tutorials. Does anyone know of an example that I can follow of setting up two tables and inserting into two tables from the same Button_click event. Thanks, John Hi jfeeney, You just need to reme...

table splited into multiple tables, what's the procedure of updating multiple tables in GridView?
hello all, i have a 5-table normalized database, with primary keys and foreign keys ...and when i present the data using GridView, i use a VIEW the collects columns from all tables ...the problem is that, when using GridView & SqlDataSource, the SqlDataSource update command doesn't work because it has to update multiple tables.so i'm asking what's the right procedure when using normalized DB and GridView that make me enable editing and deletion built in GridView's capablities ?  thx all in advance. GLORY~Please mark as answer if this helps u~  use so...

Update row in Table A from row in Table B
Hello, I have 2 tables.... table A and table B. Ok, In a stored procedure, I pass in an int value @ID I want to get the row from Table B WHERE ID =@ID....and then UPDATE the Row in Table A that has the same ID...with the values from table B. Table A ID | Col1 | Col2 ----------------------- 2 a a Table B ID | Col1 | Col2 ----------------------- 2 b b I would like to update A.Col1 with B.Col1 and A.Col2 with B.Col2 Can someone help me out with this syntax? Thanks a lot. update tableA ...

Update a rows in one table for each row in other table
Hello all, i am a newbie in SQL and i want to ask for your help in order to do the following update statement. I have a table tblUsers which holds all the users, one of the fields in their GroupId. In the UserGroup table i have a field "UsersCount" and in that field i want to keep the number of the users in that group. Basically i want everytime i am saving a user to recalculate the users in all usergroups. I am trying to have something like:SELECT User_GroupId, count(User_GroupId) as UsersCount FROM tblUsersWHERE DeletedFlag = 0 GROUP BY User_GroupId and then:"FOR EACH" User_GroupIdUPDAT...

How can i do a multiple insert or multiple updates or inserts and updates to the same table..
Hi...  I have data that i am getting through a dbf file. and i am dumping that data to a sql server... and then taking the data from the sql server after scrubing it i put it into the production database.. right my stored procedure handles a single plan only... but now there may be two or more plans together in the same sql server database which i need to scrub and then update that particular plan already exists or inserts if they dont...   this is my sproc...  ALTER PROCEDURE [dbo].[usp_Import_Plan] @ClientId int, @UserId int = NULL, @HistoryId int, @ShowS...

From Table to Table
I am working in Delphi 4 and ran into a roadblock I am unfamiliar with. I am trying to search and find values in one table based off of matching values in another. For example a table of objects with fields like name, description, type, ect; and a table of object properties in which each object can be represented multiple times based on the settings on the page at the time. So if i search the object property table (and eventually loop through to repeat for all objects) to find all cases of visible objects when a certain criteria is met. It stops on the first object with "Yes" in th...

Inserting rows from a dataset (source
I have a question... I have a dataset that I fill from multiple datasets... basically 3 tables and 2 views fill this dataset. Now, I want to stick all that data into a database temp table. If I was doing it table to table, I could use the SELECT INTO or INSERT statement, but the views (and there is no way around using them) throw the wrench into the gears. So with that in mind I have a dataset that fills just nicely with the data from both view and tables and now I need to insert that dataset into a table. Any idea how to do this?...

Insert multiple rows to table based on values from other 2 tables.
I have a form to assign JOB SITES to previously created PROJECT.  The  JOB SITES appear in the DataList as it varies based on customer. It can be 3 to 50 JOB SITES per PROJECT. I have "PROJECT" table with all necessary fields for project information and "JOBSITES" table for job sites. I also created a new table called "PROJECTSITES"  which has only 2 columns:  "ProjectId" and "SiteId". What I am trying to do is to insert multiple rows into that "PROJECTSITES" table based on which checkbox was checked.  The...

Tables?! Why Tables?!
Bit random...but why does everything have to be rendered as a table?  It's starting to get quite annoying.  Formview - does this need to be a table?  the Menu??  Wouldn't it make sense to allow the option to...say...not render a Menu as a table?  Am I the only one that thinks this or are there others?  www.internetgeeks.co.ukwww.norwichbookclub.co.uk You can use CSS Adapters to create your own adapters to override how the controls render it self. In the next version of ASP.Net, you will probably have more flexibility to specify the surrounding elements of th...

Deleting the master table withour deleting the child tables
Hi i have to delete the master table data without deleting the child table records,is there any solution for this,  parent table has relation with the child table. regards vinod.t.vSoftware EngineerUshustechTechnoparkTrivandrum India You need to temporarily disable constraints on the table. Disable constraints: ALTER TABLE MyTable NOCHECK CONSTRAINT ALL Enable constraints: ALTER TABLE MyTable CHECK CONSTRAINT ALL    If this post was useful to you, please mark it as answer. Thank you! Thanks johram i can try this solution, this is usefullSoftware Enginee...

insert multiple values from one table into one column from another table?
Hi, I'm attempting to create an insert statement that gets the values from multiple columns and insert them into one column from another table, is there a simple solution to do this?Here is something similar to what i'm wanting done, just it's not the correct way to do it, i want value1, value2 and value3 from one table to be combined and put into the value1 column of another table, what am i doing wrong? INSERT INTO tablename2 (value1 + value2 + value3)SELECT value1FROM tablename1 thanks in advance! INSERT INTO tablename2 (SELECT val1 + val2 + val3 FROM tabl...

On update trigger I can't show rows in the inserted and deleted tables
Hi all: I have two tables named A and B. The first has an after insert trigger with an "update B set......" statement in the source, and the second table has an after update trigger. Both insert and update work fine but when I check the rows from inserted or deleted tables inside of after update trigger on table B its haven't rows. Both triggers was created using transact-sql syntax on sql anywhere 7.0.4 build 3519 Any help would be appreciable Thanks in advance Hern=e1n inserted and deleted on work in T-SQL triggers. To code a T-SQL trigger you need to use ...

Web resources about - Showing table columns from multiple tables in Formview, but insert/update/delete rows of Master table - asp.net.presentation-controls

Code division multiple access - Wikipedia, the free encyclopedia
Code division multiple access ( CDMA ) is a channel access method used by various radio communication technologies. It should not be confused ...

Women Share How They Reach Multiple Orgasms In New Study 5
... triple) the pleasure. For some, it's just a notion and for others it's part of their sex lives, but research suggests anyone can achieve multiple ...

Instagram Officially Adds Support for Multiple Accounts
Instagram officially announced the ability for users to switch between multiple accounts. The feature had been spotted in testing for Android ...

How to add multiple Instagram accounts on your iPhone
Multiple accounts are available now in Instagram , at long last ( and officially , too). But the process of configuring more than one account ...

Ole Miss Football Reportedly Cited for Multiple Violations by NCAA
Bleacher Report Ole Miss Football Reportedly Cited for Multiple Violations by NCAA Bleacher Report The NCAA charged Ole Miss with a slew of ...

Exit polls: Donald Trump wins with multiple groups of voters - CNNPolitics.com
... with the Republican Party and the federal government, and the candidate who railed hardest on those topics, Donald Trump, won with multiple ...

Managing multiple Instagram accounts is finally a lot easier
Switching between multiple Instagram accounts is finally going to get a whole lot easier this week. Instagram has been testing a new feature ...

Facebook is testing SMS, multiple accounts in Messenger
Facebook has slowly beefed up its Messenger offering over the past year, with not only the ability to send payments and hail an Uber ride, but ...

Instagram App Now Allows Multiple Accounts. Here's How To Do It
... its most eagerly anticipated features. Much to the delight of bloggers and business users everywhere, it’s now possible to switch between multiple ...

Scientists attack Zika virus from multiple angles
Scientists attack Zika virus from multiple angles

Resources last updated: 2/14/2016 3:20:42 AM