Thank you Cor
I will explain more details
I have a table of Access Database. There is an field ID with AutoNumber type
that is the primary key in this table.
I show the data of this table in a DataGrid using a dataset with a
connection.
I have some TextBox(es) that present data of the current record in the
DataGrid by using data Binding (of course, there is a textbox to present
ID).
You can see that it is ver common. Everthing works fine.
Now I want to add a new record into this table (or datagrid). When I click
add new button with the code
Me.BindingContext(DataGrid1.DataSource, "Clients").AddNew()
all TextBox(es) are empty then I can enter new data for the new record. I do
not enter value for the ID textbox field as it is AutoNumber. However, when
I click Update,
da1.Update(ds)
there is message that ask me the fiel ID shoud not be Null. Why I have to do
that when I already set that field as AutoNumber type (of course, I set when
I create that table in Access).
Is it clear???
Thanks
"Cor Ligthert" <no************@planet.nl> wrote in message
news:u7**************@TK2MSFTNGP15.phx.gbl...
S. Hoa,
Brad shows you the XSD generated when you use the designer and a strongly
typed dataset.
This kind of questions are almost impossible to answer withouth some code.
You see it yourself. Nobody know how you do it, there are so many
possibilities, so the least what you would show in my opinion is show some
code (10 rows) how you add that row.
Or is it done alone with the * than tell that.
Your problem is probably around the autoincrement and the three properties
from that.
http://msdn.microsoft.com/library/de...ementtopic.asp
I hope this helps?
Cor
"HS1" <so*@slingshot.co.nz>
But here is WindowsForms
"Brad Shook" <bs****@echd.org.removeme> wrote in message
news:Ou**************@TK2MSFTNGP10.phx.gbl... Check the XSD file containing the table the AutoField should have the
attribute AutoIncrement="true"
EX.
<xs:element name="LocationId" msdata:AutoIncrement="true" type="xs:int"
/>
Brad Shook
"HS1" <so*@slingshot.co.nz> wrote in message
news:1098149437.839697@ftpsrv1...
> Hello
>
> I have a table in Access Database. This table has a AutoNumber field.
I use
> a DataGrid to show that table
>
> When I insert a new record in for this table using a DataGrid, there
is a > message that asks me to enter the value for this AutoNumber field.
Why > I
> have to do that?
>
> Could you please help
> Thank you
> S.Hoa
>
>