473,836 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

update data store via code only

After much frustration I was able to update my data store via code only.
Using the data adapter was the only way I was able to set up all the objects
written in my code. Basically, I cheated by creating an adapter and then
copy, paste, modify it's code to suite my needs. This was the end result:

Private sub updateTable( )

Dim myData As DataSet
'Command is a form level oledbcommand object
Dim Adapter1 As New OleDbDataAdapte r(Command)
myData = New DataSet()
myData = Me.DataGrid1.Da taSource

Dim Cno As OleDbConnection
Cno = New OleDbConnection (Me.strConnecti onString)

'************** *************** *************** ******
' here is where my copy, paste, modify code from
'adapter control starts
'************** *************** *************** *****

Adapter1.Update Command = New OleDbCommand()
'best way to get parameters and update string is to create them
'using an oledbdataadapte r control

Dim strUpdate As String = "UPDATE employee SET [Employee Number] = ?, [First
Name] = ?, [Last Name] = ? WHER" & _
"E ([Employee Number] = ?) AND ([First Name] = ? OR ? IS NULL AND [First
Name] IS" & _
" NULL) AND ([Last Name] = ? OR ? IS NULL AND [Last Name] IS NULL)"

With Adapter1.Update Command
..CommandText = strUpdate
..Connection = Cno

..Parameters.Ad d(New OleDbParameter( "Employee_Numbe r",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte),
"Employee Number", System.Data.Dat aRowVersion.Cur rent, Nothing))

..Parameters.Ad d(New OleDbParameter( "First_Name ",
System.Data.Ole Db.OleDbType.Va rWChar, 25, "First Name"))

..Parameters.Ad d(New OleDbParameter( "Last_Name" ,
System.Data.Ole Db.OleDbType.Va rWChar, 25, "Last Name"))

..Parameters.Ad d(New OleDbParameter( "Original_Emplo yee_Number",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte),
"Employee Number", System.Data.Dat aRowVersion.Ori ginal, Nothing))

..Parameters.Ad d(New OleDbParameter( "Original_First _Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
"First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

..Parameters.Ad d(New OleDbParameter( "Original_First _Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
"First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

..Parameters.Ad d(New OleDbParameter( "Original_Last_ Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
"Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

..Parameters.Ad d(New OleDbParameter( "Original_Last_ Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
"Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
End With

'************** *************** **********
'here is where it ends
'************** *************** **********

Try
Adapter1.Update (myData.Tables( 0))
Catch prob As OleDbException
MsgBox(prob.Mes sage)
End Try
end sub
I was never able to get the commandbuilder to work. I just think this is a
lot of coding where is previous version doing this in code was much simpler.
Have I just been spoiled by vb6 and it's simplicity?
Nov 20 '05 #1
4 1837
I haven't flipped through all of this code b/c it's working so I can't tell
what was wrong with the commandbuilder. Usually it's very easy to use - the
only catch is you must have a PK field in it and you can't control your
concurrency options. With that in mind, all you need is a valid Select
statement so it can infer the rest of the CRUD info and you're good to go.
If you want to post the code, I'll be glad to take a look at it.

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"William" <no**@none.co m> wrote in message
news:35******** *******@bignews 6.bellsouth.net ...
After much frustration I was able to update my data store via code only.
Using the data adapter was the only way I was able to set up all the objects written in my code. Basically, I cheated by creating an adapter and then
copy, paste, modify it's code to suite my needs. This was the end result:

Private sub updateTable( )

Dim myData As DataSet
'Command is a form level oledbcommand object
Dim Adapter1 As New OleDbDataAdapte r(Command)
myData = New DataSet()
myData = Me.DataGrid1.Da taSource

Dim Cno As OleDbConnection
Cno = New OleDbConnection (Me.strConnecti onString)

'************** *************** *************** ******
' here is where my copy, paste, modify code from
'adapter control starts
'************** *************** *************** *****

Adapter1.Update Command = New OleDbCommand()
'best way to get parameters and update string is to create them
'using an oledbdataadapte r control

Dim strUpdate As String = "UPDATE employee SET [Employee Number] = ?, [First Name] = ?, [Last Name] = ? WHER" & _
"E ([Employee Number] = ?) AND ([First Name] = ? OR ? IS NULL AND [First
Name] IS" & _
" NULL) AND ([Last Name] = ? OR ? IS NULL AND [Last Name] IS NULL)"

With Adapter1.Update Command
.CommandText = strUpdate
.Connection = Cno

.Parameters.Add (New OleDbParameter( "Employee_Numbe r",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte), "Employee Number", System.Data.Dat aRowVersion.Cur rent, Nothing))

.Parameters.Add (New OleDbParameter( "First_Name ",
System.Data.Ole Db.OleDbType.Va rWChar, 25, "First Name"))

.Parameters.Add (New OleDbParameter( "Last_Name" ,
System.Data.Ole Db.OleDbType.Va rWChar, 25, "Last Name"))

.Parameters.Add (New OleDbParameter( "Original_Emplo yee_Number",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte), "Employee Number", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_First _Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_First _Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_Last_ Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_Last_ Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
End With

'************** *************** **********
'here is where it ends
'************** *************** **********

Try
Adapter1.Update (myData.Tables( 0))
Catch prob As OleDbException
MsgBox(prob.Mes sage)
End Try
end sub
I was never able to get the commandbuilder to work. I just think this is a lot of coding where is previous version doing this in code was much simpler. Have I just been spoiled by vb6 and it's simplicity?

Nov 20 '05 #2
IMHO Command Builder and Wizards are only good for quick tests when your
trying to look at functionality of something or to get a connection string
etc.

You are really better off buying an ADO.NET books and working through it,
yes its slow, yes it can be painfull, but ultimatley it is worth the effort
because at least then you know how it all hangs together.

CommandBuilder/Wizards are only any good for simple Select Statements.
Regards - OHM
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"William" <no**@none.co m> wrote in message
news:35******** *******@bignews 6.bellsouth.net ...
After much frustration I was able to update my data store via code only.
Using the data adapter was the only way I was able to set up all the objects written in my code. Basically, I cheated by creating an adapter and then
copy, paste, modify it's code to suite my needs. This was the end result:

Private sub updateTable( )

Dim myData As DataSet
'Command is a form level oledbcommand object
Dim Adapter1 As New OleDbDataAdapte r(Command)
myData = New DataSet()
myData = Me.DataGrid1.Da taSource

Dim Cno As OleDbConnection
Cno = New OleDbConnection (Me.strConnecti onString)

'************** *************** *************** ******
' here is where my copy, paste, modify code from
'adapter control starts
'************** *************** *************** *****

Adapter1.Update Command = New OleDbCommand()
'best way to get parameters and update string is to create them
'using an oledbdataadapte r control

Dim strUpdate As String = "UPDATE employee SET [Employee Number] = ?, [First Name] = ?, [Last Name] = ? WHER" & _
"E ([Employee Number] = ?) AND ([First Name] = ? OR ? IS NULL AND [First
Name] IS" & _
" NULL) AND ([Last Name] = ? OR ? IS NULL AND [Last Name] IS NULL)"

With Adapter1.Update Command
.CommandText = strUpdate
.Connection = Cno

.Parameters.Add (New OleDbParameter( "Employee_Numbe r",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte), "Employee Number", System.Data.Dat aRowVersion.Cur rent, Nothing))

.Parameters.Add (New OleDbParameter( "First_Name ",
System.Data.Ole Db.OleDbType.Va rWChar, 25, "First Name"))

.Parameters.Add (New OleDbParameter( "Last_Name" ,
System.Data.Ole Db.OleDbType.Va rWChar, 25, "Last Name"))

.Parameters.Add (New OleDbParameter( "Original_Emplo yee_Number",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte), "Employee Number", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_First _Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_First _Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_Last_ Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_Last_ Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte), "Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
End With

'************** *************** **********
'here is where it ends
'************** *************** **********

Try
Adapter1.Update (myData.Tables( 0))
Catch prob As OleDbException
MsgBox(prob.Mes sage)
End Try
end sub
I was never able to get the commandbuilder to work. I just think this is a lot of coding where is previous version doing this in code was much simpler. Have I just been spoiled by vb6 and it's simplicity?

Nov 20 '05 #3
Try setting the QuotePrefix and QuoteSuffix properties to '[' and ']',
respectively. I believe the problem is that some of your column's have
spaces in the name, and without these symbols around the names, there is a
syntax error.

"William" <no**@none.co m> wrote in message
news:wS******** ***********@big news3.bellsouth .net...
William, thanks for the help. Here is the last version of my commandbuilder code I used after many revision that never worked.

Private Sub btnCommandBuild er_Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnCommandBuild er.Click

Dim cb As OleDbCommandBui lder
Dim con As New OleDbConnection (Me.strConnecti onString)
Dim myDat As New DataSet()

'form level adapter
Adapter.SelectC ommand = New OleDbCommand("s elect * from employee", con)

cb = New OleDbCommandBui lder(Adapter)

myDat = Me.DataGrid1.Da taSource

Try
Adapter.Update( myDat.Tables(0) )

Catch prob As Exception
MsgBox(prob.Mes sage)

End Try

End Sub
This one keeps barking about Syntax error in update statement. I am curious as to the PK field since I never implemented it in my commandbuilder. It is implemented in the data store however. I am thinking this might be part if not all the problem

"William Ryan eMVP" <do********@com cast.nospam.net > wrote in message
news:OK******** ******@TK2MSFTN GP11.phx.gbl...
I haven't flipped through all of this code b/c it's working so I can't

tell
what was wrong with the commandbuilder. Usually it's very easy to use -

the
only catch is you must have a PK field in it and you can't control your
concurrency options. With that in mind, all you need is a valid Select
statement so it can infer the rest of the CRUD info and you're good to go.
If you want to post the code, I'll be glad to take a look at it.

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"William" <no**@none.co m> wrote in message
news:35******** *******@bignews 6.bellsouth.net ...
After much frustration I was able to update my data store via code only. Using the data adapter was the only way I was able to set up all the

objects
written in my code. Basically, I cheated by creating an adapter and

then copy, paste, modify it's code to suite my needs. This was the end result:
Private sub updateTable( )

Dim myData As DataSet
'Command is a form level oledbcommand object
Dim Adapter1 As New OleDbDataAdapte r(Command)
myData = New DataSet()
myData = Me.DataGrid1.Da taSource

Dim Cno As OleDbConnection
Cno = New OleDbConnection (Me.strConnecti onString)

'************** *************** *************** ******
' here is where my copy, paste, modify code from
'adapter control starts
'************** *************** *************** *****

Adapter1.Update Command = New OleDbCommand()
'best way to get parameters and update string is to create them
'using an oledbdataadapte r control

Dim strUpdate As String = "UPDATE employee SET [Employee Number] = ?,

[First
Name] = ?, [Last Name] = ? WHER" & _
"E ([Employee Number] = ?) AND ([First Name] = ? OR ? IS NULL AND [First Name] IS" & _
" NULL) AND ([Last Name] = ? OR ? IS NULL AND [Last Name] IS NULL)"

With Adapter1.Update Command
.CommandText = strUpdate
.Connection = Cno

.Parameters.Add (New OleDbParameter( "Employee_Numbe r",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0,

Byte),
"Employee Number", System.Data.Dat aRowVersion.Cur rent, Nothing))

.Parameters.Add (New OleDbParameter( "First_Name ",
System.Data.Ole Db.OleDbType.Va rWChar, 25, "First Name"))

.Parameters.Add (New OleDbParameter( "Last_Name" ,
System.Data.Ole Db.OleDbType.Va rWChar, 25, "Last Name"))

.Parameters.Add (New OleDbParameter( "Original_Emplo yee_Number",
System.Data.Ole Db.OleDbType.Sm allInt, 0,
System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0,

Byte),
"Employee Number", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_First _Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0,

Byte),
"First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_First _Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0,

Byte),
"First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_Last_ Name",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0,

Byte),
"Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))

.Parameters.Add (New OleDbParameter( "Original_Last_ Name1",
System.Data.Ole Db.OleDbType.Va rWChar, 25,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0,

Byte),
"Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
End With

'************** *************** **********
'here is where it ends
'************** *************** **********

Try
Adapter1.Update (myData.Tables( 0))
Catch prob As OleDbException
MsgBox(prob.Mes sage)
End Try
end sub
I was never able to get the commandbuilder to work. I just think this

is
a
lot of coding where is previous version doing this in code was much

simpler.
Have I just been spoiled by vb6 and it's simplicity?



Nov 20 '05 #4
Mariana you are a genass (genious). You know how when you get so entrenched
in a problem that you start to believe that the problem is so complex that
the only solution is a complex solution. Now it all seems so much simpler.
That first step is a doozy.
Thanks again
"Marina" <so*****@nospam .com> wrote in message
news:OD******** ******@TK2MSFTN GP10.phx.gbl...
Try setting the QuotePrefix and QuoteSuffix properties to '[' and ']',
respectively. I believe the problem is that some of your column's have
spaces in the name, and without these symbols around the names, there is a
syntax error.

"William" <no**@none.co m> wrote in message
news:wS******** ***********@big news3.bellsouth .net...
William, thanks for the help. Here is the last version of my commandbuilder
code I used after many revision that never worked.

Private Sub btnCommandBuild er_Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnCommandBuild er.Click

Dim cb As OleDbCommandBui lder
Dim con As New OleDbConnection (Me.strConnecti onString)
Dim myDat As New DataSet()

'form level adapter
Adapter.SelectC ommand = New OleDbCommand("s elect * from employee", con)

cb = New OleDbCommandBui lder(Adapter)

myDat = Me.DataGrid1.Da taSource

Try
Adapter.Update( myDat.Tables(0) )

Catch prob As Exception
MsgBox(prob.Mes sage)

End Try

End Sub
This one keeps barking about Syntax error in update statement. I am

curious
as to the PK field since I never implemented it in my commandbuilder. It is
implemented in the data store however. I am thinking this might be
part if
not all the problem

"William Ryan eMVP" <do********@com cast.nospam.net > wrote in message
news:OK******** ******@TK2MSFTN GP11.phx.gbl...
I haven't flipped through all of this code b/c it's working so I can't

tell
what was wrong with the commandbuilder. Usually it's very easy to use - the
only catch is you must have a PK field in it and you can't control
your concurrency options. With that in mind, all you need is a valid Select statement so it can infer the rest of the CRUD info and you're good to

go. If you want to post the code, I'll be glad to take a look at it.

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"William" <no**@none.co m> wrote in message
news:35******** *******@bignews 6.bellsouth.net ...
> After much frustration I was able to update my data store via code only. > Using the data adapter was the only way I was able to set up all the
objects
> written in my code. Basically, I cheated by creating an adapter and

then
> copy, paste, modify it's code to suite my needs. This was the end

result:
>
> Private sub updateTable( )
>
> Dim myData As DataSet
> 'Command is a form level oledbcommand object
> Dim Adapter1 As New OleDbDataAdapte r(Command)
> myData = New DataSet()
> myData = Me.DataGrid1.Da taSource
>
> Dim Cno As OleDbConnection
> Cno = New OleDbConnection (Me.strConnecti onString)
>
> '************** *************** *************** ******
> ' here is where my copy, paste, modify code from
> 'adapter control starts
> '************** *************** *************** *****
>
> Adapter1.Update Command = New OleDbCommand()
> 'best way to get parameters and update string is to create them
> 'using an oledbdataadapte r control
>
> Dim strUpdate As String = "UPDATE employee SET [Employee Number] = ?, [First
> Name] = ?, [Last Name] = ? WHER" & _
> "E ([Employee Number] = ?) AND ([First Name] = ? OR ? IS NULL AND [First > Name] IS" & _
> " NULL) AND ([Last Name] = ? OR ? IS NULL AND [Last Name] IS NULL)"
>
> With Adapter1.Update Command
> .CommandText = strUpdate
> .Connection = Cno
>
> .Parameters.Add (New OleDbParameter( "Employee_Numbe r",
> System.Data.Ole Db.OleDbType.Sm allInt, 0,
> System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte),
> "Employee Number", System.Data.Dat aRowVersion.Cur rent, Nothing))
>
> .Parameters.Add (New OleDbParameter( "First_Name ",
> System.Data.Ole Db.OleDbType.Va rWChar, 25, "First Name"))
>
> .Parameters.Add (New OleDbParameter( "Last_Name" ,
> System.Data.Ole Db.OleDbType.Va rWChar, 25, "Last Name"))
>
> .Parameters.Add (New OleDbParameter( "Original_Emplo yee_Number",
> System.Data.Ole Db.OleDbType.Sm allInt, 0,
> System.Data.Par ameterDirection .Input, False, CType(5, Byte), CType(0, Byte),
> "Employee Number", System.Data.Dat aRowVersion.Ori ginal, Nothing))
>
> .Parameters.Add (New OleDbParameter( "Original_First _Name",
> System.Data.Ole Db.OleDbType.Va rWChar, 25,
> System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
> "First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
>
> .Parameters.Add (New OleDbParameter( "Original_First _Name1",
> System.Data.Ole Db.OleDbType.Va rWChar, 25,
> System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
> "First Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
>
> .Parameters.Add (New OleDbParameter( "Original_Last_ Name",
> System.Data.Ole Db.OleDbType.Va rWChar, 25,
> System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
> "Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
>
> .Parameters.Add (New OleDbParameter( "Original_Last_ Name1",
> System.Data.Ole Db.OleDbType.Va rWChar, 25,
> System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
> "Last Name", System.Data.Dat aRowVersion.Ori ginal, Nothing))
> End With
>
> '************** *************** **********
> 'here is where it ends
> '************** *************** **********
>
> Try
> Adapter1.Update (myData.Tables( 0))
> Catch prob As OleDbException
> MsgBox(prob.Mes sage)
> End Try
> end sub
>
>
> I was never able to get the commandbuilder to work. I just think

this is
a
> lot of coding where is previous version doing this in code was much
simpler.
> Have I just been spoiled by vb6 and it's simplicity?
>
>



Nov 20 '05 #5

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

Similar topics

4
6143
by: shank | last post by:
Visually, the page will look somewhat like a spreadsheet. It could have hundreds of records (rows) displayed. I want to enable the user to edit any one or any number of records and any fields, then click a save button to UPDATE the SQL table. I'd like to use stored procedures if possible. How is this done? Where do I start? thanks
4
79493
by: gooday | last post by:
Table test2 has multiple amounts for each account, I would like to sum the amounts for the same account and use the result to update the variable 'tot_amount' in table test1. But SQL does not allow me to use sum function in update. Is there any other way to do this? Thanks. update test1 set tot_amount=sum(b.amount) from test1 as a join test2 as b on a.acc_no=b.acc_no
10
9393
by: Hank1234 | last post by:
Can I use one Data Adapter and one Command Builder to update amny tables? Currently in my data adapter I query two tables and fill them into two tables in a data set. When I make a change to a record in the second table and call the update method of the data adapter the command builders update command text is for the first table. Can the command builder handle two tables? Code example: Dim oCOnn As New SqlConnection("Data Source=.;" &...
10
2054
by: Jim | last post by:
Hi, Let me explain how I'd generally do things. For a page where the user edits data, I'd generally call it something like editfred.php (for example), the page which updates the data would be called updatefred.php and equally the page which processes a delete would be deletefred.php. I like splitting the pages up this way, it feels less cluttered and more organised than throwing all the functionality in one fred.php.
3
1634
by: Simon | last post by:
Hi everyone, I have a small problem regarding a wizard that I'm making on my website. The wizard is obviously a series of pages that take values from the user. My question is: - Should I store all the values entered until the last page and then update the database, or should I do it as I go.
2
1135
by: Mark Whitton | last post by:
Hi, I am developing using ASP.Net using SQL Server and also have several layers in between, eventually producing a custom business object that is used to populate the web form. I don't use datasets because of performance issues and also they just aren't proper business entities. When it comes to updating my database I generally use an identity value and a datetime value to avoid multiple updates. e.g. Update Customers set ..... where...
30
3411
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on the dataset or connection? TIA
5
2603
by: Stephen Plotnick | last post by:
I'm very new to VB.NET 2003 Here is what I have accomplished: MainSelectForm - Selects an item In a public class I pass a DataViewRow to ItemInformation1 Form ItemInformation2 Form
2
3118
by: Miro | last post by:
I will ask the question first then fumble thru trying to explain myself so i dont waste too much of your time. Question / Statement - Every mdb table needs a PrimaryKey ( or maybe an index - i havnt tested the index yet ) so you can use an .UPDATE( dataTable ) on the data adapter. Otherwise you will get an exception error. Is this statement true? ---- Now me fumbling thru
0
9825
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9673
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10859
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10260
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9388
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7795
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4463
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 we have to send another system
2
4023
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.