// http://stackoverflow.com/questions/2974868/what-is-the-syntax-in-linq-to-insert-a-record-using-objectset-instead-of-using // http://stackoverflow.com/questions/1011519/entity-framework-entitykey-foreign-key-problem public void InsertList(tblHtml htmlListObject) { // Create database context. //var ctx = new seleniumScrapeEntities(); //ctx.tblHtmls.AddObject(htmlListObject); //ctx.SaveChanges(); }
// Use similar to this below to create a new tblHTMLrow. public void AddHTMLtoList(string tableElementHTML) { // Add the scraped html to the list. var htmlData = new tblHtml { html_data = tableElementHTML, // Set the vehicle ID for the HTML Vehicle_id_fk = vehicleID, // Set the Time Stamp field Search_Date_Timestamp = DateTime.Now, // Set the search session Search_Session_ID_fk = searchSessionID }; // Add to db AddToDb(htmlData); }
private void AddToDb(tblHtml htmlData) { var addHtmlToDb = new CreateHTMLlist(); addHtmlToDb.InsertList(htmlData); }
/// <summary> /// Create a new tblHtml object. /// </summary> /// <param name="html_id_pk">Initial value of the html_id_pk property.</param> public static tblHtml CreatetblHtml(global::System.Int32 html_id_pk) { tblHtml tblHtml = new tblHtml(); tblHtml.html_id_pk = html_id_pk; return tblHtml; }
/// <summary> /// Deprecated Method for adding a new object to the tblHtmls EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotblHtmls(tblHtml tblHtml) { base.AddObject("tblHtmls", tblHtml); }