G
Guest
Hi ther
First off, sorry for this long post, but I think it is needed to explain my proble
I have this dataset I am working with named dsMyDataset I am trying to add data to the dataset/ access database in the following manner
Dim arMyLines As DataRow = dsMyDataset.MyRecords.NewRo
odcMyConnection.Open(
Dim holdNumber As Intege
holdNumber = dsMyDataset.Tables("MyRecords").Rows.Count +
Tr
arMyLines ("Number") = holdNumbe
arMyLines ("Date") = CDate(Label1.Text
arMyLines ("Home") = TextBox1.Tex
arMyLines ("Away") = TextBox2.Tex
dsMyDataset.Tables("MyRecords").Rows.Add(arMyLines
odaMyAdapter.Update(dsMyDataset
Catc
arMyLines.Delete(
dsMyDataset.Clear(
End Tr
odcMyConnection.Close()
What I am trying to do is count the number of rows in the dataset/database, add 1 to it and put that number under the “Number†column in the database along wit the other row dat
holdNumber always contain the number 1 and the “TRY†throws an error saying, in not so many words, I have two of the same records
I removed all the primary keys in the dataset and the access database and still get the same error
I have setup the database exactly the way it is suppose to be
The problem is with the “Number†Column since I already have 1 in first row of the databas
For some reason holdNumber = dsMyDataset.Tables("MyRecords").Rows.Count is not counting the number of rows in the dataset/database. It always shows 0
So adding 1 to 0 gives you 1 and the "number" column already have a 1 (the first row) in i
Any ideas on how to solve this
Once again, sorry about the length of thi
First off, sorry for this long post, but I think it is needed to explain my proble
I have this dataset I am working with named dsMyDataset I am trying to add data to the dataset/ access database in the following manner
Dim arMyLines As DataRow = dsMyDataset.MyRecords.NewRo
odcMyConnection.Open(
Dim holdNumber As Intege
holdNumber = dsMyDataset.Tables("MyRecords").Rows.Count +
Tr
arMyLines ("Number") = holdNumbe
arMyLines ("Date") = CDate(Label1.Text
arMyLines ("Home") = TextBox1.Tex
arMyLines ("Away") = TextBox2.Tex
dsMyDataset.Tables("MyRecords").Rows.Add(arMyLines
odaMyAdapter.Update(dsMyDataset
Catc
arMyLines.Delete(
dsMyDataset.Clear(
End Tr
odcMyConnection.Close()
What I am trying to do is count the number of rows in the dataset/database, add 1 to it and put that number under the “Number†column in the database along wit the other row dat
holdNumber always contain the number 1 and the “TRY†throws an error saying, in not so many words, I have two of the same records
I removed all the primary keys in the dataset and the access database and still get the same error
I have setup the database exactly the way it is suppose to be
The problem is with the “Number†Column since I already have 1 in first row of the databas
For some reason holdNumber = dsMyDataset.Tables("MyRecords").Rows.Count is not counting the number of rows in the dataset/database. It always shows 0
So adding 1 to 0 gives you 1 and the "number" column already have a 1 (the first row) in i
Any ideas on how to solve this
Once again, sorry about the length of thi