holyoneksk
New Member
string strConnection = ConnectionString();<BR> OleDbConnection objConnection = new OleDbConnection(strConnection);<BR> <BR> string strAddEmployeeSQL = "SELECT * FROM OrgEmployee";<BR> DataSet objDataSet = new DataSet();<BR> OleDbDataAdapter objAdapter = new OleDbDataAdapter(strAddEmployeeSQL, objConnection);<BR> objAdapter.Fill(objDataSet, "OrgEmployee");<BR> <BR> DataTable objTable;<BR> DataRow objNewRow;<BR> <BR> objTable = objDataSet.Tables["OrgEmployee"];<BR> objNewRow = objTable.NewRow();<BR> objNewRow["FEID"] = Request.Cookies["PayOut"]["FEID"];<BR> objNewRow["SSN"] = Request.Form["SSN"];<BR> objNewRow["LName"] = Request.Form["LastName"];<BR> objNewRow["FName"] = Request.Form["FirstName"];<BR> objNewRow["MName"] = Request.Form["MiddleName"];<BR>objTable.Rows.Add(objNewRow);<BR> <BR> OleDbCommandBuilder objBuilder = new OleDbCommandBuilder(objAdapter);<BR> objAdapter.UpdateCommand = objBuilder.GetUpdateCommand();<BR> objAdapter.InsertCommand = objBuilder.GetInsertCommand();<BR> objAdapter.DeleteCommand = objBuilder.GetDeleteCommand();<BR> objAdapter.Update(objDataSet, "OrgEmployee");<BR><BR>I get an error that says: Syntax error in INSERT INTO statement.<BR>So my question is how do I view the SQL statement or how can I figure out what field is giving me the truble?<BR><BR>I have alot of fields othere then the few I am showing so I want to know what one is having problems updating.<BR><BR>Thanks - This is a major helpIf you have Debug = "True" on your aspx page<BR><BR><%@ Page Language="VB" EnableViewState = "True" Debug="True"%><BR><BR>you should get a decent error message which may help.<BR><BR>I don't know of a way to pinpoint the exact field that is giving the problem. Even stepping through the code in VB.Net isn't likely to show it.<BR><BR>There is a debugger capability with the SDK, but it's a pain to use and I don't think it will give you much more info.<BR><BR>Other than placing a prefix on each field (such as r ) I don't know of an easy way to pinpoint a field name that is a violation of reserved words.<BR><BR>Sorry,<BR><BR>TT