Hi guys,
This is my first post here. Actually wanted to insert record into an sql database (using sql server 2000 and visual studio 2000)
I'm using a dataview to see if the user already exists. This, i've been able to retrieve and it works.
Now if the user does not exist, then i add the new user using parameter passing.
strInsert = "Insert INTO tbl_user(username,password,firstname,lastname,email,status,dateRegistered,sex,type_id,school_id)Values(@username,@password,@firstname,@lastname,@email,@status,@dateRegistered,@sex,@type_id,@school_id)"
cmdInsertUser = New SqlCommand(strInsert, sqlConn)
cmdInsertUser.Parameters.Add("@username", txtUsername.Text.ToLower)
...and so on
cmdInsertUser.ExecuteNonQuery()
I'm getting an error in terms of id cannot be null for my user_id. Doesn't it increment by itself? I'm not using stored procedures.
Is there a way to do this (and without stored procedures)?
Thanks for a reply
Dany