[RESOLVED] Access Database write Problem
Ok i fixed my problem now but what's happening is that the data is always being overwrited. I mean there is only one row which is constantly being overwrited
Code:
Public Class Form1
Private Sub UpdateTable(ByVal Details As String())
Dim DataSet As New LoginServerDataSet
Dim Adapter As New LoginServerDataSetTableAdapters.DetailsTableAdapter
Dim Manager As New LoginServerDataSetTableAdapters.TableAdapterManager
Manager.DetailsTableAdapter = Adapter
DataSet.Details.Rows.Add(Details)
Manager.UpdateAll(DataSet)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
UpdateTable({"1", "Name3", "Pass"})
End Sub
End Class
Thanks in advance =]
Re: Access Database write Problem
Hmmmm.... classic example of ells being in your hovercraft. Try removing them...
We're not psychic here... quite honestly I'm not sure how that rumor ever got started... Normally we see one of two types of posts, and rarely ever the third kind... the first kind are the ones that mention what the error is but not the code. The second kind are the ones that give us the code but not what the error is, or what line it happens on. The third kind is the most rarest of all... the kind that give all of the details, the problem ,the error, the code, what has been tried, what doesn't work and what does work. Guess where yours falls? Type 2. If you want a better answer, you'll need to make it a type 3 posting....
-tg
Re: Access Database write Problem
Sorry Dude :) I just had a problem but while I was writing the post I remembered something and tried to fix it. Now I did and got a new problem :[
Re: Access Database write Problem
OK.... that link I mentioned in my signature? NOW would be a good time to check it out...see if it's something that applies in this situation.
-tg
Re: Access Database write Problem
If you mean the search, to be honest I did search. I usually though like fixing things myself and not finding them ready. Its my fault because I didnt put my question properly.
Ok first of all here is my code:
Code:
Public Class Form1
Dim DataSet As New LoginServerDataSet
Dim Adapter As New LoginServerDataSetTableAdapters.DetailsTableAdapter
Dim Manager As New LoginServerDataSetTableAdapters.TableAdapterManager
Private Sub UpdateTable(ByVal Details As String())
DataSet.Details.Rows.Add(Details)
Manager.UpdateAll(DataSet)
End Sub
Private Sub LoadTable()
Dim reader As New DataTableReader(DataSet.Details)
DataSet.Load(reader, LoadOption.OverwriteChanges, DataSet.Details)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Manager.DetailsTableAdapter = Adapter
End Sub
End Class
Edit: I cant manage to load the data :S Should I create a virtual table and load it in it? Thanks in advance
Re: Access Database write Problem
my bad... I think i got my threads crossed...
the link I thought I had mentioned was this one: http://msdn.microsoft.com/en-us/libr...89(VS.80).aspx
-tg
Re: Access Database write Problem
Thanks tg I managed on my own :)