Generate A Unique ID Using Char?
Nov 24, 2009
I'm creating a program, and as part of it I'm storing a customer ID, which will be automatically generated using some form of combination of the customer's first name and surname? My thought so far has been to declare individual characters as Char and then put them together to automatically generate a customer ID? Problem being
View 7 Replies
ADVERTISEMENT
Jun 18, 2009
I need to generate a globally unique ID of fixed 16-lengthThe GUID is too long for my purpose. So I wonder is there any way to convert it to a 16-length?If this is not possible, I have a program key of 8 chars, and is thinking of using the DateTime as my key.
View 4 Replies
May 12, 2006
I want to generate a unique ID in VB.NET that starts with ASXXXXX where XXXX represents a number. The number has to start in an orderly fashion. This ID will then be stored in a SQL Server express table.
View 8 Replies
Jul 14, 2009
I am generating license key for our software. I have encrypted the input data and converted it to base64string. Now i want to generate a 12 character key from it. How to I generate a representative and unique key?
View 3 Replies
Mar 19, 2011
I have a webpage Default.aspx which generate the id for each new user after that the id will be subbmitted to database on button click on Default.aspx...
if onother user is also entering the same time the id will be the same ... till they press button on default.aspx
How to get rid of this issue...so that ... each user will be alloted the unique id ..
View 4 Replies
Sep 20, 2011
I have no idea about this. Actually i have create one form like personnel requisition form.hen user open the form, ref no will appear at the top of the form. ref no is used to search any personnel requisition later.
View 5 Replies
Oct 12, 2010
I once posted a question on generating a policy number by table ID and user selctions from comboboxes. [URL]FYI . I am doing my project in vb, that why i posted it here. I managed to do that when i choose a region and product from two different comboboxes i generate a number but now my problem is that whenever i click on the comboboxes a policy number is generated before i save the record, so if my previous nummber was 72100002 whenever i click on the product combobox i generate a number e.g if i click on it five times by the time i save the number would be 72100007. I am using a stored procedure for this. Is there another way of doing this or i might end up with my first record as 72100001 and my second record 72100006.
[Code]...
View 2 Replies
Aug 2, 2009
I have an application that is made for a game that you have to draw cards for. So what I have done is created a random number generator that generates a random number and then using case statements that number is associated with a picture of the card, which is displayed in a picture box. This part works fine. Each time I draw a card it is not reshuffled so I need to store the random number generated and then if that number is generated again ignore it an generate a new number.
Now to complicate matters even further when a certain card is drawn the entire deck is reshuffled and everything starts over again. Here is what I tried... I tried using arrays to store the numbers but I cannot seem to get it to search the array for the number or store the number properly within the array. The array has to be dynamic since the game is expandable and I will be adding more cards to the game in the future.
View 18 Replies
Apr 1, 2007
I am working on a Bingo game and I am stuck. I got the program to generate random number but they are not unique. I dont know how to fix this. I have researched online and nothing this is my last resource. I am using Visual Basics 2005 Express Edition. [code]
View 9 Replies
May 12, 2011
This question is virtually the same as this SO post, only I'm looking for a VB.NET (.NET 4) solution. I've spun my wheels long enough trying to come up with a generic solution to solving this "power set" problem.
Dim choices As IEnumerable(Of String) = {"Coffee", "Tea", "Milk", "Cookies"}
Dim choiceSets = choices.CombineAll()
I'm looking for choiceSets to be an IEnumerable(Of IEnumerable(Of T)) so that I can do something like:
For each choiceSet in choiceSets
Console.WriteLine(String.Join(", ", choiceSet))
Next
[code]...
As you can see, this is every non-repeating combination from the source IEnumerable(Of T) (which could have 1 to many items in it - this example only had 4), it operates based on the order of the items in the source IEnumerable(Of T), and each item in the list is >= the previous item in terms of number of items in the inner IEnumerable(Of T).
For what it's worth, this is not homework; though it sure does feel like it. EDIT: Updated the example so it does not look like the result is alphabetically sorted, to stress that the source IEnumerable(Of T)'s existing order is used and added a 4th choice to clarify the sorting requirement within each set.
View 5 Replies
Apr 15, 2011
I am trying to generate Unique and prominently random colors in c# or vb.net. I am using below code now. But this code generating color almost same color, not big change.How can unique kind of colors?
[code]...
View 3 Replies
Dec 21, 2009
How would I go about generating a unique receipt number in the following range:
GA00000-GZ99999? I am not allowed to use the 'I' and 'O' letters so GI00000-GI99999 & GO00000-GO99999 would be excluded. Ideally, I'd like to create this in T-SQL but can also do it in VB.Net. This number will be stored in SQL and I can access it prior to generating the next one. They do not have to be sequential.
View 4 Replies
Apr 9, 2009
how to generate unique ID based on combobox selection?
View 5 Replies
Jul 19, 2007
Is there a way to auto generate unique number on the form when an application starts up and it should incremente in the dataadapter and database too. How can i set it up?
View 10 Replies
Sep 21, 2010
I'm developing a policy administration system and I need to generate a unique policy in this formart
RP000000/HH
Where R is the Region i select from a Combobox, P is the product the client chooses and the auto generated six digit number and HH is the hour when the record was entered in the system. I want the auto generated number to be the ID in my ClientDetails table in my DB.Here is my code of what I have done so far.They want to be able to tell the region and the product by just looking at the policy number.
Private Function PolicyNumber(ByVal intRegion As Int16, ByVal intProductCover As Int16) As String
PolicyNumber = intRegion.ToString & intProductCover.ToString & "000000" & "/" & Hour(Now).ToString
End Function
[code]....
View 2 Replies
Apr 15, 2010
I'm creating a radio streaming application, which plays a live stream from various radio stations in a small 'gadget' like application.
The user can add his own custom radio stations, by supplying a Name, a StreamUrl and, optionally, an Image that represents a logo or something of that radio station.The logo will be drawn on the main form when that station is selected.
I need to be able to save these custom stations, and I think it makes sense to use an XML file, which could then look something like this
<CustomStations>
<Station>
<Name>Radio 1</Name>
[code]....
Before I added the support for images, this worked fine, how to store the images. I want the user to be able to select any image from his harddrive, but I don't want to force him to keep that image in the same location afterwards. So I can't rely on the path that he selected. Instead, I want to simply load the image from the path he selected, and then save it somewhere else.
I am storing the XML file in the common application data path which I think is a good place for the images too.The problem is, how to determine a name for the images? I will always have just one image per custom radio station, so it makes sense to me to simply have one Images folder that holds all images, with a unique name.I can see two solutions:
1. Generate a random filename for every image
2. Use the Name of the radio station as the image name
For option 1, I suppose I could just create a string of 16 random characters and call that the filename. The problem of course is that there is no guarantee that I will get a unique filename. Yes, the chances of generating the same name twice randomly are very tiny, but it's still possible, and I just don't like that. How can I ensure that my random filename is unique? I suppose I could always drop the whole thing in a While loop that continues when the new filename already exists, but there must be a better way... Is there nothing in the framework that allows me to generate a unique random filename, in a directory of my choice (so not in the Temp directory...)
I like option 2 much better. The Name of a radio station is unique (there can't be two stations with the same name), so I don't have to worry about filenames conflicting. The problem with this approach is that there are no restrictions on the name. There's nothing stopping the user from naming their custom station "Radio~/aij!""_.fe" or something like that, which is obviously not a valid filename... So, I will have to do 'something' to generate a valid filename from the station name. I could simply remove all non-valid path characters from the name, but then I am no longer guaranteed a unique filename... Suppose there's two stations, one called "Radio/1" and one "Radio1", then after removing the invalid "/" character, the names will be the same and so I will generate the same image path for both....
View 8 Replies
Oct 6, 2011
The program must generate 6 unique random numbers but when I click display numbers sometimes it gives me 6 unique numbers and sometimes I get duplicate numbers. I will add the code I have so far.
Public Class frmMain
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
[CODE]...
View 9 Replies
Dec 16, 2008
i want to read a character 1 by 1 from a string and a .txt, i know all about stream reader so for the .txt would it be somthing like:textbox1.text = tr.readCharacter.i would prefer to be able to read from a textbox or String array though.
View 10 Replies
Mar 30, 2012
I need validation for string to comply with next: no space char starts with one delimiter char ends with one delimiter char has no other char as delimiter char. Updated sorry missed that should only be one delimiter char at start and at the end
View 2 Replies
Sep 30, 2010
Public Shared Function UrlTokenDecode(ByVal input As String) As Byte()
If (input Is Nothing) Then
Throw New ArgumentNullException("input")[code].....
View 3 Replies
Feb 13, 2012
I am using VB .Net to access the eBay API and store all completed orders in a database. This database is then fed into a proprietary shipping system, which can not handle an order number larger than 20 characters. eBay returns an order number like so 230407279314-680141236013 which is too long. The order number is always 12 numbers a hyphen and 12 more numbers. What I need to do, is turn this (the result can be alpha numerical) into a shorter, unique order key to store in my database alongside the true orderId (so that this can be referenced by the shipping software instead of the actual order number). The reason for the 20 character limit is the barcode algorithm used. Is there any way to achieve this in VB .Net 2010? This number can be anything unique, so long as it does not exist already (even a good uniqueid function would work, but I would have to query the database to make sure it isn't taken)
View 2 Replies
Jan 10, 2009
I'm using the datagridview. This is the sample data:
[Code]....
How do I parse through the grid to rename the duplicate values in a particular column (in this example it's the l_name field) into such a format?
[Code]....
View 1 Replies
Mar 21, 2011
How generate the unique no. 1,2,3 and so on .... on button click of each new user ..
the code mentioned below is a readwrite coding in vb.net ...
but the problem is it generate the same id for different users on button click event... but i want the no. of times button clicked the new ids will be generated
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FILE_NAME As String = Server.MapPath("counts.vbi")
[Code].....
View 1 Replies
May 19, 2009
i am trying to increment a char in vb.net, eg: Dim letter As Char = "a"c. and i want to make it b, and so on. how can i do this?
View 1 Replies
May 8, 2011
Unique constraint - these columns currently doesn't have unique values..?? I have created Unique Constraint with 3 columns. My code works perfectly but once - two users @ same time entered same data and somehow it saved in DB; after that incident. This UniqueConstraint gives me error - These columns currently doesn't have unique values. How can I check if user enters this kind of entry or how can I restrict the Entry?
View 2 Replies
Mar 22, 2012
I have split a string into a char array, now i need to copy the char array to an int array with the ASCII values of each char.Donīt know how to do it without looping each value.
This is my code:
origen = RichTextBox1.Text.ToString
Dim valor As Char() = origen.ToCharArray
Dim numeros As Integer() = (How can i convert "valor" to an int array?????)
View 10 Replies
Jan 6, 2012
This my working method to send a email
Sub emailConfirm()
Dim email As String = txtMail.Text
Dim name As String = txtPrenom.Text + txtNom.Text[code]....
note:I want to send Link contains a unique identifier and verify the unique identifier in the login.aspx.I don't know when to do this...I found nothing interesting on the net ...
View 1 Replies
Jun 5, 2009
i have found [char] specified in some of the examples at msdn , what is the difference between char and [char]
View 2 Replies
Dec 12, 2010
I have a textbox with value in it like: "577457747037375770" and so on, i want to XOR each value of them with "0x1b" how can i do that ?Like "0x1b" XOR 57 ; "0x1b" XOR 74 ; "0x1b" XOR 87 and so on for all value in textbox.I don't want to check if the value in the textbox is in the good format, i want just XOR them all.
View 2 Replies
Jul 14, 2011
I have a DLL that I am importing:Declare Function QueryInfo Lib "mydllname" (ByVal DevName As String, ByVal pcQueryParam As String, ByVal Result As String, ByVal Length As Int32) As Int32
[Code]...
Anyone have an idea what the issue could be? If I run similar code in VB6 (only diff is mtStatus = String(mtValueSize, Chr$(0)) ) it returns what I expect.
View 7 Replies