Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've got a datagrid and a dataadapter that I used the wizard to create Select, Insert, Update, delete stored proc. I'm trying to get the code to let me work in the data grid and fire the right sp's in the back ground. Here is what I have so far.. it works for an insert, but I can't get the Delete, Update to work. can someone point me in the right direction. Also, what can I through in the debug.writeline or something along those lines to see what is happening..

 

   Private Sub grdServerList_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdServerList.CurrentCellChanged
       Debug.WriteLine(Me.myDataSet1.HasChanges)
       Dim custdb As SqlCommandBuilder = New SqlCommandBuilder(myDataAdapter)

       Try
           Me.myDataAdapter.Update(Me.myDataSet1, "Exceptions")
           Me.myDataSet1.AcceptChanges()
           Debug.WriteLine("Should do the update")
       Catch ex As Exception
           Debug.WriteLine(ex)
           Throw (ex)
       End Try

JvCoach23

VB.Net newbie

MS Sql Vet

  • *Experts*
Posted

What's the error message? What do the Update, Insert, Delete strings look like (you can use Debug.WriteLine to view them)?

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Here is the error.

 

{System.Data.SqlClient.SqlException}

[system.Data.SqlClient.SqlException]: {System.Data.SqlClient.SqlException}

HelpLink: Nothing

InnerException: Nothing

Message: "Procedure 'spBackupListServer_Delete' expects parameter '@Original_intTblSqlBackupServerNameId', which was not supplied."

Source: ".Net SqlClient Data Provider"

StackTrace: " at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)

at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)

at SqlWatch.frmAddServer.grdServerList_CurrentCellChanged(Object sender, EventArgs e) in C:\Documents and Settings\S011038.SAUDER\My Documents\Visual Studio Projects 2003\SqlWatch\frmAddServer.vb:line 204"

TargetSite: {System.Reflection.RuntimeMethodInfo}

 

I'm not sure what 've not done..

JvCoach23

VB.Net newbie

MS Sql Vet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...