How to generate GUID for new rows

T

TNS

Hi,

I'm relatively new to Infopath development, so maybe this is a simple
question, but I haven't been able to find a clear answer anywhere.
We have a SQL Server database where the keys are uniqueidentifier
(GUID's). A simple webservice layer which returns Datasets for
viewing/quering and accepts Datasets for updating has been made. The
infopath forms use the webservice layer, but right now the end user has
to enter Guid's when inserting new rows. How can I get Infopath to
automatically create Guid's for new rows? - or could this be
accomplished in another way (i.e. the webservice layer creating the
Guid's)?

Any help would be appreciated.

Regards,
Thomas N. Sørensen
 
F

Franck Dauché

Hi,

One solution to this is to create an unique ID column, which is different
from your table primary key. For new record, you can generate the ID using
the System.Guid.NewGuid() method for example.

Regards,

Franck Dauché
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top