windows application with sql db

mothusio

New member
Joined
Mar 12, 2009
Messages
2
Programming Experience
1-3
hi

im creating an ip address with windows application,the application is supposd to assign a user an un-assigned ip address and save it in the database .how do i search the database for unassigned addresses and allocate them to a user.

mothusi
 
What im trying to achieve is like an "intelligent" db that can automatically assign a new user a vacant ip address,to avoid having more than one user using the same ip address
 
Obviously you can't search the database for an unassigned IP address because the database only contains assigned IP addresses. You can't search for something that isn't there. You need some algorithm for generating IP addresses to start with. You would then apply that algorithm to get a result and check whether it already exists, or else get the last generated IP address and apply your algorithm to get the next one. Your algorithm might be as simple as adding 1 to the last octet.
 

Latest posts

Back
Top