Hi,
[quoted text, click to view] "tzvi" <u29438@uwe> wrote in message news:69a8ad0971c7a@uwe...
> Hi there!
> I just can't find the problem and therfore solution. The issue is very
> important!!!
> In .net 2005 I've built a windows application with form . Inside the
> project
> i've attached the .mdb file , wich afterwords i've connected threw server
> explorer and pulled it to an .xsd file i've created also inside my
> application project before that.
> I got all the needed connections to all of the tables existing in the
> access
> database including relationships,tables and adapters attached.
> The fill and get functions of adapter does work. - i've filled controls in
> the form with data from access database.
> Also i can add data when i'am building the insert function of the adapter
> by
> pushing "Query Builder" and then "Execute Query" .
> All that proves that the connection is right.
> the sql string that is beeing build automaticly is:
> INSERT INTO Passwords (Username,[Password]) VALUES (?,?)
>
> if i remove the '?' chars from sql string and replace them with @UserName
> it
> does not go threw compilation.
JET doesn't support named parameters.
[quoted text, click to view] > When i'm trying to activate the function from application it runs threw
> the
> line and does not add a new line in the table in access , nor it gives any
> error.
> I do get error only if at one session i'm trying to enter the same values
> twice into the Insert function.
> the error is -
> "The changes you requested to the table were not successful because they
> would create duplicate values in the index,primary key, or relationship.
> Change the data in the field or fields that contain duplicate data ,remove
> the index , or redefine the index to permit duplicate entries and try
> again."
> Do you have any idea why the data won't enter into Access database?
>
Probely you have a very common problem. When you start debugging, the DB
file (visible in solution explorer) is copied to the \bin\debug folder.
Next time it runs, it's overwritten and all previous changes are lost.
The easiest thing to do is not to agree to copy the db into your project
while configurating a datasource or dataconnection.
It's also discussed here:
http://blogs.msdn.com/smartclientdata/archive/2005/08/26/456886.aspx http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=169907&SiteID=1... HTH,
Greetings