another label as "name"
another label as "phone number" totally 3 labels are there.
and at the same time i have database as "Detail"
in that i have only there are three fields user id , name , phone number.
| User Id | Name | Phone number |
here, I need to get auto user id when i am going add new one. it need to store auto user id and i am only give two inputs to store in the database they are name and phone numbers.
that is windows application connected with database.input in the window application it need to update in the database.
My Question is how to get the auto user id?

Khargesh RajputPosted Mar 9, 2015, 5:24 AM
create table as
CREATE TABLE Detail
(
UserID int IDENTITY(1,1) PRIMARY KEY,
Name varchar(250) NOT NULL,
Phone varchar(250)
)
now you can insert only name and phone
userid will auto increment
INSERT INTO Detail(Name,Phone)
VALUES ('khargesh','123456789')