Cyberiafreak

"Fortunate are those who take the first steps.” ― Paulo Coelho

Office code – Manually written code for Update ADO.NET

‘Dim dt As DateTime
        ‘dt = Convert.ToDateTime(mm.SelectedItem.Value.Trim + "/" + dd.SelectedItem.Value.Trim & "/" & yy.SelectedItem.Value.Trim)
        ‘Dim ss As Integer
        ‘Dim ra As Integer
        ‘Dim conn As New SqlConnection("server=ADMIN-SERVER;uid=sa;pwd=adminsis;database=salesport")
        ‘Try
        ‘    Response.Write(clt_add.Text)
        ‘    Response.Write(Session("SCLT_ADD"))
        ‘    conn.Open()
        ‘    Dim cmd As New SqlCommand("Update pcl Set clt_add=’" & clt_add.Text & "’ where pcl_id = 8 ", conn)

        ‘    ra = cmd.ExecuteNonQuery()
        ‘Catch SQLExp As SqlException
        ‘    If SQLExp.Number = 1212 Then
        ‘        Response.Write("SQL Server Error 1212 Occurred: " & e.ToString())
        ‘    Else
        ‘        Response.Write("An SQL Server Error Occurred: " & e.ToString())
        ‘    End If
        ‘Finally
        ‘    conn.Close()
        ‘    If (ra) Then
        ‘        Response.Write("1 ROWS AFFECTED – SUCCESSFULLY")
        ‘        Response.Write("11 rows affected")

        ‘    End If
        ‘End Try

-============————-

Mahesh,SIS India

Advertisements

January 12, 2005 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: