Skip to content
View in the app

A better way to browse. Learn more.

Komuniti @PuTeRA

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unique Id Guna Asp

Featured Replies

Salam,

ada sesapa sini yg teror mintak tlg bantu.
saya try utk create function generate unique id guna asp @vb scripts..
unique id format camni, AP-AA-0000. hanya AA-0000 akan berubah. cth dia akan count sampai AA-9999 then start ngan AB-0001 pulak dan seterusnya la.

mintak tolong sapa yg penah buat.
senang jer. ko kena buat formula sendiri niii.
macam algorithma. aku nak citer pun malas heheheh. tapi senang aaaa hehehe
[quote name='sadis' date='01 July 2010 - 05:08 PM' timestamp='1277975309' post='1039865']
Salam,

ada sesapa sini yg teror mintak tlg bantu.
saya try utk create function generate unique id guna asp @vb scripts..
unique id format camni, AP-AA-0000. hanya AA-0000 akan berubah. cth dia akan count sampai AA-9999 then start ngan AB-0001 pulak dan seterusnya la.

mintak tolong sapa yg penah buat.
[/quote]


buat macam nie...

1. read dari DB last inserted number secara descending..macam nie.."Select top 1 <field> from <table> order by <field> DESC"
2. kalau x de value dari db..masukkan data(initial value) macam y ko nak tu.. "AP-AA-0000"
3. lepas dah masukkan, ko update number tu guna function nie...(ak pakai c# ko pandai2 la convert kan)

[code]

public void updateRunningCode()
{
string noPangkal = valueDariDB.substring(0,2);
int runningTemp = Convert.ToInt32(valueDariDB.substring (5,10));
runningTemp++;


[b] if(runningTemp <10000)
{
string runningCode = noPangkal + "AA" + String.Format("{0:0000}", runningTemp);

}[/b]
}

[/code]

(part y ak bold kan tu ko pk kan sendiri..ak x sure ade ke x string format utuk ABC )
lepas dah update no tu..store balik dalam db..

sekian...harap dapat mmbantu..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.