Where you call SQLExecute(), replace that line with the following:
oconn.Open()
oCommand.ExecuteNonQuery()
>So then the question is, "How can I send updates to the Database?"
>
>
>
>>You need to pass a select statement to the Toolkit's SQLExecute function. It then returns a filled DataView. This function is not intended to pass an Update statement. This is being considered to be revised for a future update to the toolkit.
>>
>>>Here is the code.
>>>
>>>********* Save Routine *****
>>> ' Set up connection and command
>>> Dim oconn As System.Data.OleDb.OleDbConnection
>>> Dim oCommand As New OleDbCommand()
>>>
>>> ' passing parameter to stored procedure
>>> ' I have tried both Char and VarChar for OLEdb
>>> Dim oparam1 As New OleDbParameter("@cssn", OleDb.OleDbType.VarChar)
>>>
>>> ' gcpuem is a memvar which contains the connectin string
>>> oconn = SqlConnect(gcPuem)
>>>
>>> oCommand.CommandType = CommandType.StoredProcedure
>>>
>>> ' _TestUpdate is the SP being called, code is below.
>>> oCommand.CommandText = "_TestUpdate"
>>>
>>> oCommand.Parameters.Clear()
>>> 'storing employee ssn, value is 000110000
>>> oparam1.Value = Me.txtcssn.ClipText
>>> oCommand.Parameters.Add(oparam1)
>>>
>>> ' Bug in ToolKit, should be fixed in future release but need this
>>> ' code for now.
>>> oCommand.Connection = oconn
>>>
>>> ' Tried both of the following lines with the same results.
>>> ' gvEmployee = SqlExecute(oconn, oCommand) ', "curEmployee")
>>> SqlExecute(oconn, oCommand)
>>>
>>> ' Close the connection
>>> SqlDisConnect(oconn)
>>>
>>>
>>>*** Stored Procedure Code ***
>>>
>>>CREATE PROCEDURE _TestUpdate
>>>' Test SP only!
>>>@cssn as char(9)
>>>
>>>AS
>>>
>>>update pclaim set cssn = @cssn where pid = 2
>>>GO
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi