The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: xQL Edits - DB.xql


  • Subject: RE: xQL Edits - DB.xql
  • From: "Neil Frost" <neil@xxxxxxxxxxxxx>
  • Date: Fri, 25 Feb 2005 14:23:15 -0000


Hi Tony,

Not sure if this is what you would be after...

http://www.startvbdotnet.com/ado/default.aspx
has some stuff on ADO.NET and data providers etc.

Some examples of the vb.net update, insert and delete are here:

http://www.startvbdotnet.com/ado/sqlserver1.aspx

If that's not what you need, let me know and I'll do another search.

Cheers V Much

Neil

Incase you have no internet connection at the moment....


Updating Records

We will update a row in Authors table. Drag a button onto the form and
place the following code.

Imports System.Data.SqlClient
Public Class Form4 Inherits System.Windows.Forms.Form
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim ra as Integer
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e_
As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e_
As System.EventArgs) Handles Button1.Click
myConnection = New
SqlConnection("server=localhost;uid=sa;pwd=;database=pubs")
'you need to provide password for sql server
myConnection.Open()
myCommand = New SqlCommand("Update Authors Set city='Oakland' where
city=_
'San Jose' ",myConnection)
ra=myCommand.ExecuteNonQuery()
MessageBox.Show("Records affected" & ra)
myConnection.Close()
End Sub
End Class


________________________________

From: Tony Tofts [mailto:tony@xxxxxxx]
Sent: Fri 25/02/2005 14:19
To: ukha_xpl@xxxxxxx
Subject: RE: [ukha_xpl] xQL Edits - DB.xql




> Is there anyway to change this at all so that xQL can update
> SQL instead of just adding, please....

Hi Neil,

You can't equate the xpl xql commands with what is actually happening.

In the case of an 'EDIT' command all it does is open the supplied sql
statement and then

sqls_select(SQLID).Fields(x).Value = e.GetParam(1,
sqls_select(SQLID).Fields(x).Name)

No 'edit' is used

If you can give me sample vb.net code that will 'update' a sql server
record, I can add an 'update' command to xql

Regards
Tony



xPL Links: http://www.xplproject.org.uk http://www.xplhal.com http://www.xpl.myby.co.uk
To Post a Message: ukha_xpl@xxxxxxx
To Subscribe:  ukha_xpl-subscribe@xxxxxxx
To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx

xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.