Advertisement
Advertisement
| 04.07.2008 at 08:07AM PDT, ID: 23301593 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: |
<%@Page language="vb" explicit="true" debug="true"%>
<%@Import Namespace="System.Data"%>
<%@Import Namespace="System.Data.OleDb"%>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
If Page.IsPostback then
InsertRecord()
End If
End Sub
Sub InsertRecord()
Dim conClasf As OleDbConnection
Dim cmdClasf As New OleDbCommand
Dim strClasf As String
Dim strSQL As String
Dim intRowsAff As Integer
lblErrMsg.Text = ""
lblRecsAff.Text = ""
conClasf = New OleDbConnection( _
"Provider=OraOLEDB.Oracle;Persist Security Info=False;" & _
"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nova.umuc.edu)" & _
"(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=acad)));User Id=CM485B09;Password=d5h6x7e6;")
conClasf.Open
strSQL = "INSERT INTO sale VALUES (" & intSaleID.Value & ", " & intAgentID.Value & _
", " & intHomeID.Value & ", "' & intCustID.Value & _
'", " & intContractID.Value & ", "' & saleDate.Value & '", " & saleAmount.Value & ") "
cmdClasf = New OleDbCommand(strSQL, conClasf)
Try
intRowsAff = cmdClasf.ExecuteNonQuery()
Catch ex as exception
lblErrMsg.Text = ex.Message
End Try
lblRecsAff.Text = intRowsAff & "record(s) inserted"
conClasf.Close
End Sub
</script>
<html>
<head>
<title>Insert New Sale</title>
</head>
|