Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

PANO PO MAG AUTO GENERATE NG ID NO. using C# sa Visual Strudio 2010 :pls:

pa help naman po , hindi pa po kasi ako mshado magaling mag program eh. Baguhan pa lang din po ako.

View attachment 1265496


Sa SQL Server Database mo, gawa ka ng field na datatype nya is int. Then i-modify mo ung column property nya. Pano gawin to?
Identity Specification > Yes > Is Identity > Yes.
 
tama si sir puuts . dagdag ko lang iprimary key mo din yung column mo . right click > primary key. pag may lumabas na susi na icon sa tabi ng column mo ok na yun :) .
 
Naka primary key na po sya, at nka yes na rin yung sa Identity. Ang problem po kasi eh pag ni click ko yung SAVE button eh hndi ng auto increment yung ID Number
 
yung data ba sa table mo upon save di padin naka auto increment ? ibig sabihin nun baka d talaga naka set yung field na gusto mo i auto increment

parang ganito

declare @emp AS table
(
empID INT IDENTITY(1,1),
firstname varchar(100),
lastname varchar(100)
)

INSERT INTO @emp
(firstname,lastname)
values
('Juan','Dela Cruz')

INSERT INTO @emp
values
('Juan','Aaaaaa')

INSERT INTO @emp
values
('Juan','Bbbbb')

SELECT * FROM @emp ORDER BY empID desc

tas tawagin mo nalang sa C# yung ID number diyan sa table na nag iincrement yung id number
 
nka auto increment naman po ung ID number, as integer
 
ito try mo poh. kung marunong kana sa ganyan ka coding mas madali mo yang ma modified gamit ang code na ito.

value = 123;
Console.WriteLine(value.ToString("00000"));
Console.WriteLine(combo.SelectedItem.ToString()+ "-" + String.Format("{0:00000}", value));
// Displays ABC-00123
 
San p yan ilalagay na code na yan ,sa ADD button b?
 
Back
Top Bottom