Further along in this code I'm trying to access processRow, which is of type DataRow, but I get a RowNotInTableException This row has been removed from a table and does not have any data. In an attempt to figure out when this data is getting deleted, I added a bunch of `cq_id = processRow["cq_id"].ToString();` throughout. See code below for where it's breaking. I also discovered that if I get rid of the Task, this error goes away, but I need that. I can't figure out why I'm getting such an exception as nowhere in the code am I deleting anything. …

Member Avatar
Member Avatar
+0 forum 1

Hi All, Im trying to Insert a new row into a database and refresh the dataset. This is what I have so far: [CODE]void ButtonInsert(object s, EventArgs e) { string connectionString = null; OleDbConnection connection; OleDbCommand cmd = new OleDbCommand(); string sql = null; connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;data source=Book.mdb"; connection = new OleDbConnection(connectionString); sql = "INSERT INTO Books (BookKey, Title, Pages, AuthorKey, PublisherID) Values ('12','A1BC','999','12','14')"; connection.Open(); cmd.CommandText = sql; cmd.Connection = connection; cmd.Parameters.Add("@Title", OleDbType.VarChar, 50, "Title"); cmd.Parameters.Add("@BookKey", OleDbType.VarChar, 50, "BookKey"); cmd.ExecuteNonQuery(); connection.Close(); refreshlist(); // restarts the form }[/CODE] When i click the Insert Button it inputs the data into the database …

Member Avatar
Member Avatar
+0 forum 2

Hi! Thanks for trying to help me! I'm building a program that will allow me to have a different form for each person in my database. When the program first starts, I want it to cycle through the database and open a form for each row (each person). I'm generally failing to understand the methodology for connecting directly to a DB to construct queries, and I'm still fuzzy on how DataRow works... I'm using VisualStudio 2010 .Net4 and a MS SQL Server Compact DB (no password). The database is called Persons.sdf, the only table in the DB is called PeopleTable …

Member Avatar
Member Avatar
+0 forum 2

i have a problem with saving data to access database this is my code [CODE] Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If inc <> -1 Then Dim cb As New OleDb.OleDbCommandBuilder(da) Dim dsNewRow As DataRow dsNewRow = ds.Tables("Personnel").NewRow() dsNewRow.Item("PerID") = txtPersonnelID.Text dsNewRow.Item("FirstName") = txtFirstName.Text dsNewRow.Item("Lastname") = txtLastName.Text dsNewRow.Item("Middlename") = txtMiddleName.Text dsNewRow.Item("Gender") = txtGender.Text dsNewRow.Item("Address") = txtAddress.Text dsNewRow.Item("ContactNo") = txtContactNo.Text dsNewRow.Item("EmailAddress") = txtEmailAdd.Text dsNewRow.Item("BDay") = txtBday.Text dsNewRow.Item("Department") = txtDept.Text dsNewRow.Item("HiredDate") = txtHiredDate.Text dsNewRow.Item("RenewalDate") = txtRenewalDate.Text ds.Tables("Personnel").Rows.Add(dsNewRow) da.Update(ds, "Personnel") MsgBox("New Record added to the Database") btnSave.Enabled = False btnAddNew.Enabled = True btnUpdate.Enabled = True btnDelete.Enabled = …

Member Avatar
Member Avatar
+0 forum 15

I'll preface this by giving a bit of an overview of what I'm trying for here. I'm trying to create a quasi-blog. Something that I can "post" journal type entries directly to a page in my website but without all the luggage that comes with the readily available blog engines and without viewer reply capability. Essentially it's just going to be an interface where I can enter a post which gets stored on a database and a dynamically loading page that shows the most recent post with the option to navigate to prior posts (and back forward again). Here's the …

Member Avatar
Member Avatar
+0 forum 4

Hi, I have an issue involving retrieving a set of child rows in a dataset. I have populated a dataset with three tables Categories, Projects and Tasks. In the dataset relations I have set up a relationship between Categories and Projects and between Projects and Tasks. [CODE] Private Sub Defaults_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load .... with myDset .tables(0).TableName ="Categories" .tables(0).Columns("CategoryID").Unique = True .tables(1).TableName ="Projects" .tables(1).Columns("ProjectCode").Unique = True .tables(2).TableName ="Tasks" .tables(2).Columns("TaskCode").Unique = True with .relations .Add("ProjectCategory", myDSet.Tables("Categories").Columns("CategoryID"), myDSet.Tables("Projects").Columns("CategoryID")) .Add("ProjectTasks", myDSet.Tables("Projects").Columns("ProjectCode"), myDSet.Tables("Tasks").Columns("ProjectCode")) end with end with ..... end sub [/CODE] This all works fine when I debug. …

Member Avatar
Member Avatar
+0 forum 2

The End.