Hi Jason,
Try using question marks (?) instead of @name in sql statement and make sure
you set parameters in same order.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group
www.codezone-si.info
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
>
> I can't get the below update to work. Here's what I know..
> If I enter fixed strings in the update it works. The response.write
> displays show good and updated values in the s strings. However, only
> the @chain cmd.Param gets set, all others,like @responsible either
> never get set or remain as they were. Strangley, I have this code in
> another subroutine whree I'm adding a brand new record and it works
> fine. I've copied the block of working text in and view the source in
> hex and everything looks fine. I need another pair of eyes.
>
> THANK YOU.
>
>
> Public Sub UserGrid_Update (Source As Object, E As
> DataGridCommandEventArgs)
> Dim objConn as new
> OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=x.mdb")
>
> Dim cmd As OleDbCommand = new OleDbCommand ("UPDATE tbl SET
> status=@status, responsible=@responsible WHERE chain=@chain", objConn)
>
> Dim schain As String = e.Item.Cells(2).Text
> Dim sresponsible As String = CType(e.Item.Cells(3).Controls (0),
> TextBox).Text
> Dim sstatus As String = CType(e.Item.Cells(4).Controls (0),
> TextBox).Text
> Dim swaitingon As String = CType(e.Item.Cells(5).Controls (0),
> TextBox).Text
> Dim scomments As String = CType(e.Item.Cells(6).Controls (0),
> TextBox).Text
>
>
> response.write(schain+"-"+sresponsible+"-"+sstatus+"-"+swaitingon+"-"+scomments)
>
> cmd.Parameters.Add(new OleDbParameter("@chain", schain))
> cmd.Parameters.Add(new OleDbParameter("@responsible",
> sresponsible))
> cmd.Parameters.Add(new OleDbParameter("@status", sstatus))
> cmd.Parameters.Add(new OleDbParameter("@waitingon", swaitingon))
>
> cmd.Parameters.Add(new OleDbParameter("@comments", scomments))
>
>
> objConn.Open()
> cmd.ExecuteNonQuery()
> objConn.Close
>
> ' UserGrid.EditItemIndex = -1
> BindData()
>
>
>
> End Sub
>