All pastes #253793 Raw Edit

Unnamed

public text v1 · immutable
#253793 ·published 2006-11-21 02:48 UTC
rendered paste body
string strIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); 
string strAgent = Request.ServerVariables["HTTP_USER_AGENT"].ToString();
string strRef = Request.ServerVariables["HTTP_REFERER"].ToString();
string resLoc;
if(uploadSuccess == "yes")
{
resLoc = strBaseLocation+strFileNameOnServer;
}
else
{
resLoc = "";
}
SqlCommand myCommand;	
	try
    {
		
    
	using (SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString))
    {
        connection.Open();
	

string strSql = "INSERT INTO careers('id','firstname','lastname','address','city','state','zip','dayphone','nightphone','email','cover','resume','ip','ref','agent','datetime') VALUES('"+rndNum+"','"+first.Value+"','"+last.Value+"','"+address.Value+"','"+city.Value+"','"+state.Text+"','"+zip.Value+"','"+dayphone.Value+"','"+nightphone.Value+"','"+email.Value+"','"+cover.Value+"','"+resLoc+"','"+strIP+"','"+strRef+"','"+strAgent+"','"+strDate+"')";

	   myCommand = new SqlCommand(strSql,connection);
	   myCommand.ExecuteNonQuery();
    }
	}
	catch(Exception e)
	{
	Response.Write(e.ToString());
	}





System.Data.SqlClient.SqlException: Invalid object name 'careers'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ASP.careers_aspx.btnUploadTheFile_Click(Object Source, EventArgs evArgs) in d:\Downloads\MetaSearch\careers.aspx:line 160