Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: how to share the data ! thanks!


Message #1 by yaping_yangey <yaping_yangey@s...> on Sun, 09 Feb 2003 18:17:38 +0800
Dear all,



I meet a problem in my work. 

a dataset datasetX have two tables tableA, tableB and tableC,

tableA have all columns of tableB's and tableC.

datasetX.tableA is modified by user in screen, and datasetX.tableB is maintained by system.

 

when tableA.columns is changed(add,delete or update), tableB.columns will be changed too, both have the same value.



It is that datasetX.tableA.columns and datasetX.tableB.columns have the same data fields, or they share the data for columns.  



I'm not sure that this function to be achieved by vb.net automated. 



I'm waiting for your help,  Thanks very much !!!  ^_^



                                          Chris Yang




______________________________________


===================================================================
免费试用新浪15M任你邮 获数码相机、手机大奖 (http://vip.sina.com/sol_mail/promotion/pro_men.html)
手机语音聊天国内长途5分钟/1元、帅哥美女靓照尽在爱情快递 (http://love.sina.com.cn)
发拜年短信 送万千祝福 赢双人港澳游大奖! (http://sms.sina.com.cn/act/spring2003.html)
Message #2 by "h@f... on Mon, 10 Feb 2003 10:31:08 -0800 (PST)
try the following code, hope ur problems will be solved about insetion, updation, deletion.

hafiz qasim

MCS Final Semester 

Punjab University, lahore, Pakistan

hafizqasim@y...

Dim constr As String = "Initial Catalog=TEMP;Data Source=localhost;Integrated Security=SSPI"

Dim cnn As SqlConnection = New SqlConnection(constr)

Dim trn As SqlTransaction

Dim cmd As New SqlCommand()

cnn.Open()

trn = cnn.BeginTransaction()

cmd.Connection = cnn

cmd.Transaction = trn

Try

cmd.CommandText = "INSERT INTO Table1(Roll,Name,Marks) VALUES (6,'e', 55)"

cmd.ExecuteNonQuery()

cmd.CommandText = "INSERT INTO Table2(Roll, Age) VALUES (6,50)"

cmd.ExecuteNonQuery()

cmd.CommandText = "Delete from table1 where Roll=6"

cmd.ExecuteNonQuery()

trn.Commit()

MsgBox("Completed Succesfully")

Catch ex As SqlException

trn.Rollback()

MsgBox("failed")

MsgBox(ex.Message)

Finally 

cnn.Close()

End Try

End Sub

 yaping_yangey <yaping_yangey@s...> wrote:Dear all,



I meet a problem in my work. 

a dataset datasetX have two tables tableA, tableB and tableC,

tableA have all columns of tableB's and tableC.

datasetX.tableA is modified by user in screen, and datasetX.tableB is maintained by system.



when tableA.columns is changed(add,delete or update), tableB.columns will be changed too, both have the same value.



It is that datasetX.tableA.columns and datasetX.tableB.columns have the same data fields, or they share the data for columns. 



I'm not sure that this function to be achieved by vb.net automated. 



I'm waiting for your help, Thanks very much !!! ^_^



Chris Yang




______________________________________


===================================================================
免费试用新浪15M任你邮 获数码相机、手机大奖 (http://vip.sina.com/sol_mail/promotion/pro_men.html)
手机语音聊天国内长途5分钟/1元、帅哥美女靓照尽在爱情快递 (http://love.sina.com.cn)
发拜年短信 送万千祝福 赢双人港澳游大奖! (http://sms.sina.com.cn/act/spring2003.html)

===
Fast Track ADO.NET with C# is a concise introduction to the concepts, techniques, and libraries that you will need in order to start
using ADO.NET in your applications. The book covers DataSets and Typed DataSets, accessing data using DataReaders and DataAdaptors,
the close relationship between ADO.NET and XML, how and where to use ADO.NET in your enterprise applications, and how to use Web
Services and ADO.NET to easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

  Return to Index