Update changes

S

simon

I have this example:

Dim myConn As New SqlConnection(myConnection)
Dim myDataAdapter As New SqlDataAdapter()
myDataAdapter.SelectCommand = New SqlCommand(mySelectQuery, myConn)
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(myDataAdapter)

myConn.Open()

Dim ds As DataSet = New DataSet
myDataAdapter.Fill(ds, myTableName)

' Code to modify data in DataSet here
myDataAdapter.Update(ds, myTableName)

myConn.Close()

I use update command to update the modified data from dataSet back into the
database.
Now I would like to know if it's possible to update the changes from dataset
back to database with stored procedure?

The problem is, that my sqlConnection has only read permissions on the
database tables and execute permission on Stored procedures.
That is for security purpose.

Is it possible and any example?

Thank you for your answer,
Simon
 
G

Guest

Now I would like to know if it's possible to update the changes from dataset
back to database with stored procedure?

The problem is, that my sqlConnection has only read permissions on the
database tables and execute permission on Stored procedures.
That is for security purpose.

Is it possible and any example?

Thank you for your answer,
Simon
Sure it´s possible - and it not hard at all!
Rember that the updatecommand is just a Command object - so there should be no problems. If you not are used to work with SP´s and the command object take a look at http://msdn.microsoft.com/library/d...tml/cpconusingstoredprocedureswithcommand.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top