Okay lets say I want to generate a primary key for organization_ID instead of manually entering it in a textbox I created.
When this program runs the user is not suppose to see the primary key when submitting this information. Basically what I want is a random unique idenfier generated.
My idea was to use some kind of count function?
When this program runs the user is not suppose to see the primary key when submitting this information. Basically what I want is a random unique idenfier generated.
My idea was to use some kind of count function?
Code:
Public Shared Function Insert_Organization() As DataSet
Dim _DBConnector As New DBConnector()
Dim ds As New DataSet
Dim query As String
Try
query = "INSERT INTO Organization (Organization_Name, Organization_Info, Organization_Statistics, Organization_Total_Donated, Organization_ID) VALUES ('" & DataBaseProject_Hunger.AddOrganization.OrgNameTextBox.Text & "', '" & DataBaseProject_Hunger.AddOrganization.TextBox1.Text & "','" & DataBaseProject_Hunger.AddOrganization.TextBox2.Text & "','" & DataBaseProject_Hunger.AddOrganization.TextBox3.Text & "','" & DataBaseProject_Hunger.AddOrganization.TextBox4.Text & "' )"
ds = _DBConnector.GetDataSet(query)
Catch err As Exception
MessageBox.Show(err.Message)
Finally
MsgBox("Added New Organization sucessfully.", MsgBoxStyle.Information, "")
End Try
Return ds
Comment