473,503 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem of updating two tables in gridview

1 New Member
Hello,
I am using a GridView control which displays data from 2 SQL tables.the columns are project_name,client_name which are from mstproject(its fields are project_id,project_name,client_id,which is a FK to mstclient(its fields are client_id,client_name)respectively.
When the user tries to insert/update the client_name the client_id should be stored in the table mstprojectSo even though in gridview client_name is displayed but client_id should be stored in the db.(i know it is confusing but)Plz tell the Sql command needed.
Please help!
Its urgent

fireburns
Jan 24 '07 #1
1 1333
enreil
86 New Member
Could you clarify a bit? Is the user updating both tables, or only the mstclient table? If only client_name is being updated in mstclient, you shouldn't need to do anything with client_id. If you are inserting a new row into client_name and want it related to mstproject, then you will need to insert a new row into mstproject that contains the client_id as a FK. There are several ways this may be accomplished, but you may try looking at some basic SQL syntax for UPDATE and INSERT commands located at http://www.mckoi.com/database/SQLSyntax.html#12

If you can clairfy what you need accomplished, I'd be glad to help.

Hello,
I am using a GridView control which displays data from 2 SQL tables.the columns are project_name,client_name which are from mstproject(its fields are project_id,project_name,client_id,which is a FK to mstclient(its fields are client_id,client_name)respectively.
When the user tries to insert/update the client_name the client_id should be stored in the table mstprojectSo even though in gridview client_name is displayed but client_id should be stored in the db.(i know it is confusing but)Plz tell the Sql command needed.
Please help!
Its urgent

fireburns
Jan 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1995
by: P | last post by:
Hello, I am having a difficult time updating a record via a stored procedure using the gridview and sqldatasource. I cannot seem to be able to find a way to set everything up so that I can pass...
0
1611
by: Ben | last post by:
Hi, It's about a database containing (for simplifying) three fields: 'placenr' (primary key), 'place' and 'color'. The records are updatable (Edit/Update button) in a gridview. For updating the...
3
1532
by: =?Utf-8?B?dmluY2VudHc1Ng==?= | last post by:
I have an ASP.NET 2.0 application. It is pretty basic. What it does is shows a gridview of data from a stored procedure. The user can also select a date filter. The problem is that sometimes an...
0
2207
by: lamolap | last post by:
i have 1 gridview , a dropdownlist inside a gridview and a commandfield of (edit, update and cancel) my gidview looks like this Edit Surname Initials ...
1
1166
by: David C | last post by:
I have a new GridView that has an SQL table as a datasource. The primary key is included but not visible. When I click the Edit link button, change a column's data and click Update, nothing...
11
4052
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
11
6042
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
0
1260
by: BizWeb | last post by:
Hi, i am new to ASP.NET. I have write a very simple code to try the updating of the GridView but it is not updating the data. Below is the simple code that i have use. <%@ Page Language="vb"...
0
1868
by: cmrhema | last post by:
Hi, I have a gridview problem while binding more than two gridviews. I am giving a sample scenario of what I have done so far I have two tables First table: Department , having columns...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.