HighTechTalks DotNet Forums  

How to insert data into wider table

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss How to insert data into wider table in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
LM
 
Posts: n/a

Default How to insert data into wider table - 11-05-2007 , 06:51 AM






There are two tables. First with fields "ProductID, ProductName and
Price", in other table there is also "NumberOItems".

How can I do this. Is it an extra field in sql query.

Here is my other code.

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim luku As Double
Dim conn As New SqlConnection("Data
Source=DV2\SQLEXPRESS;Initial Catalog=testaus;Integrated_
Security=True")
Dim cmd As New SqlCommand("insert dbo.ost select * FROM
dbo.Tuot WHERE_ Tuotekoodi=@Tuotekoodi", conn)

Dim param As New SqlParameter()
param.Direction = ParameterDirection.Input
param.ParameterName = "@Tuotekoodi"
param.SqlDbType = SqlDbType.VarChar
param.SqlValue() = Tuotekoodi
cmd.Parameters.Add(param)
cmd.Connection.Open()
luku = cmd.ExecuteNonQuery()
cmd.Connection.Close()
End Sub

I have not decided yet how to get the amount, but let say it is a
number variable initialized as "1".


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.