473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

update 2 tables

NuB
I have a web form and when the user clicks update I have to update 2 seperate
tables, How can I do that? Right now I'm using straightline SQL for this.
Feb 1 '06 #1
3 1020
Run 2 queries?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"NuB" <Nu*@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
I have a web form and when the user clicks update I have to update 2
seperate
tables, How can I do that? Right now I'm using straightline SQL for this.

Feb 1 '06 #2
NuB
I did that after i posted, BUT

How can i get the value of my check box? I have it based on a dataitem from
the database, but on the form the user can check it or uncheck it. How can I
determine if its checked or not and save it to the table?

I have this but its not saving:
if (checkbox1.checked == true)
{
value = 1;
}
else if (checkbox1.checked == false)
{
value = 0;
}
then i run my sql, but its not saving it to the table, its saving the state
it was when the page first loaded

"Kevin Spencer" wrote:
Run 2 queries?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"NuB" <Nu*@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
I have a web form and when the user clicks update I have to update 2
seperate
tables, How can I do that? Right now I'm using straightline SQL for this.


Feb 1 '06 #3
Hi there,

Are they related tables via an ID?

If so, u could have your submit button click event handle two sub routine
calls, each dealing with its own table. Of course the order of insertion
will depend on the relationship if any.
If they are related and you are using stored procedures and u need theat
first table's ID value you could use an output parameter on your first
stored procedure to send that nID back, then use that ID for the insert on
second table.
Public Sub btnSubmit_Click(ByVal Sender As Object, ByVal E As EventArgs)
Handles submitform.Click

InsertTableOne()
InsertTableTwo()

End Sub
An idea anyways, Joe :)
"NuB" <Nu*@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
I have a web form and when the user clicks update I have to update 2 seperate tables, How can I do that? Right now I'm using straightline SQL for this.

Feb 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jerry Brenner | last post by:
Our users have potentially dirty legacy data that they need to get into our application. We provide a set of staging tables, which map to our source tables, that the users do their ETL into. ...
5
by: rdraider | last post by:
Hi all, I'm looking for a way to re-number inventory items. The items exist in 50+ tables, hundreds of fields and there are several thousand items. Maybe one table could hold the list of old &...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
7
by: jaYPee | last post by:
I am having a problem on how to update view from sql server 2000 database. I have tried dataset and sql dataadapter but no luck. I'm using this view in datagrid and i want to update the datagrid if...
15
by: graham | last post by:
Hi all, <bitching and moaning section> I am asking for any help I can get here... I am at the end of my tether... I don;t consider myself a genius in any way whatsoever, but I do believe I have...
9
by: Mahesh S | last post by:
Hi I have to perform an update on a table. I am having problems figuring out how to join two tables as I need to check a value in a different table before performing the update. I have two...
15
by: Scotty | last post by:
I like to have a good insert, update and delete code The code below sometimes workl ok sometimes doesnt work, what i am doing wrong?? Sub SaveAny() Dim command_builder As New...
2
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source wizard,and made datagridview and bindingsource...
5
by: explode | last post by:
I made a procedure Public Sub Novo(ByVal nova1 As String, ByVal nova2 As String) that creates a new oledbDataAdapter with insert update select and delete commads. I also added that commands can...
0
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
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.