Using SQL with VB.Net

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts Page 1 of 1
Contributors
User avatar
kolega28
VIP - Donator
VIP - Donator
Posts: 338
Joined: Mon Jan 17, 2011 7:12 pm

Using SQL with VB.Net
kolega28
So basically I have a textbox with a number in it in a vb project, and I want to be able to store that in a database together with a user number, so like the first user of the app who generates the number will have an entry in the database which will contain the number 1 because they are the first user and the number that was generated, then the second person will have 2 and the number and so on...

I have no clue how to do this, I don't use SQL and need help, any help, preferably help with everything, from how to set up SQL to how to do the databases, just help please.
Image
User avatar
benji_19994
VIP - Donator
VIP - Donator
Posts: 156
Joined: Mon Apr 16, 2012 3:13 pm

Re: Using SQL with VB.Net
benji_19994
Hmm I don't know database hat much but I think #smashapps made a tutorial on our site [url]http://creativeprogramming.info/2013/04 ... -tutorial/[\url]
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: Using SQL with VB.Net
Dummy1912
hmm not sure if i get you correct but
you want to generate ID in the sql or you want to generate your own ID and the store it in the sql?

if you want to generate ID you need to use the Primare Key
if you want to generate them yourself you just do
Code: Select all
dim myID as integer = 0
then just do in the button section
Code: Select all
myID = +1 'not tested i write it just now :)
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

Re: Using SQL with VB.Net
smashapps
Disregard #Dummy1912 idea of incrementing the ID. When you're working with databases in Vb.Net:

(As taken from my own tutorial)

"change AutoIncrementSeed and AutoIncrementStep to 1 from -1. Changing this will mean when you add new records it will increment from 1"

follow the tutorial here: Click here

We don't use an integer and increase it by one each time we use the properties that vb.net gives us in the design view of the table because then we don't have to worry about it, it automatically increases each time.

If you need more help you can contact me I will be happy to help more.
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
User avatar
noypikami
VIP - Donator
VIP - Donator
Posts: 151
Joined: Sat Dec 22, 2012 1:49 am

Re: Using SQL with VB.Net
noypikami
You should have a primary key, in the first place you should know how to set up the primary key( ( its very important, else your database will fail) . alot of tutorials in you-tube to help you with this database.
5 posts Page 1 of 1
Return to “Coding Help & Support”