Forums
This topic is locked
internals erver error
Posted 25 Nov 2005 21:26:18
1
has voted
25 Nov 2005 21:26:18 faraz siddiqi posted:
sub onsubmit(sender As Object, e As System.EventArgs)dim nm,pswd,emal,tphone
dim em,cem,pd,cpd
dim ll as date
pd=request.form("tbpwd"
cpd=request.form("tbcpwd"
em=request.form("tbemail"
cem=request.form("tbcemail"
nm=request.form("tbname"
pswd=request.form("tbpwd"
emal=request.form("tbemail"
tphone=request.form("tbt"
Dim strSQL As String
Dim objDataSet As New DataSet()
Dim objConnection As OleDbConnection
Dim objAdapter As OleDbDataAdapter
' set the connection and query detailsDim sPath As String = Server.MapPath("matr.mdb"
Dim strconnection As String = "Provider=Microsoft.Jet.OLEDB.4.0; DATA Source=" & sPath & ";"
strSQL = "SELECT name,pwd,email,tn FROM person;"
' open the connection and set the command
objConnection = New OledbConnection(strConnection)
objAdapter = New OledbDataAdapter(strSQL, objConnection)
' fill the dataset with the data
objAdapter.Fill(objDataSet, "person"
' add a new row to the table
Dim objTable As DataTable
Dim objNewRow As DataRow
objTable = objDataSet.Tables("person"
objNewRow = objTable.NewRow()
objNewRow("name" = nm
objNewRow("email" = emal
objNewRow("pwd" = pswd
objnewrow("tn"= tphone
objTable.Rows.Add(objNewRow)
' generate the update commands
Dim objBuilder As OleDbCommandBuilder
objBuilder = New OleDbCommandBuilder(objAdapter)
objAdapter.InsertCommand = objBuilder.GetInsertCommand()
' update the data store
objAdapter.Update(objDataSet, "person"
objconnection.close()
response.redirect("registration2.aspx"
end sub
whats wrong with this code cos when i asubmit the form i have got an error displaying that
internal server error we cannot finf www url of my page on which form is displayed
please reply me an early resoipnse is highly appriciable
faraz siddiqi
islamabad pakistan
+923005348722
+923332604790
+923333665597