data grid updating - date field throwing me for a loop

From: BethF (dawg_at_alaskaSPAMFREE.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 12:38:33 -0900

I think the ctype is converting my date to a string, and therefore screwing
up my dates in the following code. Please send suggestions!

Sub Update_Grid(sender as object, e as datagridcommandeventargs)

    theid = e.item.cells(7).text
    lastname = ctype(e.item.cells(0).controls(0),textbox).text
    firstname = ctype(e.item.cells(1).controls(0),textbox).text
    extension = ctype(e.item.cells(2).controls(0),textbox).text
    emailaddress = ctype(e.item.cells(3).controls(0),textbox).text
    home = ctype(e.item.cells(4).controls(0),textbox).text
    cell = ctype(e.item.cells(5).controls(0),textbox).text
    birthday = ctype(e.item.cells(6).controls(0),textbox).text

    DBupdate.commandtext= "update tblapcausers " _
        & "set firstname= '" & firstname & "', " _
        & "lastname= '" & lastname & "', " _
        & "extension = '" & extension & "', " _
        & "emailaddress = '" & emailaddress & "', " _
        & "homephone = '" & home & "', " _
        & "cellphone = '" & cell & "', " _
        & "birthday = " & birthday & " WHERE userid = " & theid
        dbupdate.connection = dbconn
        dbupdate.connection.open
        dbupdate.executenonquery()
        dbconn.close
        dgcontactlist.edititemindex = -1
        builddatalist

End Sub



Relevant Pages

  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)
  • Re: FTP CD command
    ... My code connects to a ftp site and the enumerates all content on that place ... Public Property UriAs String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... Private _Uri As String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ... Public Sub UploadAsynch(ByVal fileName As String, ByVal uploadUrl As ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... i remember to have seen a socket level FTP ... Private _Uri As String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... Private _Uri As String ... Public Sub New(ByVal Uri As String, ... Dim listRequest As FtpWebRequest = CType, ... Public Sub UploadAsynch(ByVal fileName As String, ByVal uploadUrl As ...
    (microsoft.public.dotnet.languages.vb)