jvcoach23 Posted October 9, 2003 Posted October 9, 2003 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 Quote JvCoach23 VB.Net newbie MS Sql Vet
*Experts* Nerseus Posted October 11, 2003 *Experts* Posted October 11, 2003 What's the error message? What do the Update, Insert, Delete strings look like (you can use Debug.WriteLine to view them)? -Nerseus Quote "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
jvcoach23 Posted October 14, 2003 Author Posted October 14, 2003 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.. Quote JvCoach23 VB.Net newbie MS Sql Vet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.